1

I have everything correct, as written at laravel/algolia websites.

I tried to read lot of documentations and tutorials about Laravel Scout installation, but still can't find solution.

I have everything correct in my settings and also APIs are correct but still getting this error:

Impossible to connect, please check your Algolia Application Id.

Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64
Doctor Nasty
  • 61
  • 1
  • 9

4 Answers4

9

I had the same issue (with Windows 10) and found this exception in the stack trace:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

I found the solution for the error above in another StackOverflow post:

1) Download the latest cacert.pem from https://curl.haxx.se/ca/cacert.pem

2) Add the following line to php.ini (if this is shared hosting and you don't have access to php.ini then you could add this to .user.ini in public_html)

curl.cainfo="/path/to/downloaded/cacert.pem"

Make sure you enclose the path within double quotation marks!!!

It solved my problem, Laravel Scout is working fine after that. Hope this will help someone.

Anthem
  • 101
  • 1
  • 5
  • Thanks, problem solved, but I could not find this error in the stack trace, if anyone can share a screenshot of that, it can help. – Sunil Kumar Jan 26 '22 at 15:22
5

Apparently on the issue came from on wrong credentials, this can occurs providing the wrong Application ID or Admin API Key. Also the correct way to provide the credential on scout.php is :

'algolia' => [
'id' => env('ALGOLIA_APP_ID', ''),
'secret' => env('ALGOLIA_SECRET', '')
],

And then fill your credentials in your .env file.

I'd recommend you to run php artisan config:clear in case you have cached your configuration (which you shouldn't do in dev env).

Let us know if it solve your issue.

Klotz Tom
  • 51
  • 4
4

I had the same issue and solved it like this

php artisan cache:clear
php artisan route:clear
php artisan config:clear or config:cache

My assumption is, because Laravel always creates a cache in the config, every time we change some config, there must be another config that is broken or an error due to the cache that was created earlier.

But I don't know for sure.

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
2

I share with you my experience.

System was Vagrant Homestead with VirtualBox in Windows 10.

command used in CMD:

php artisan scout:import "App\Post"

command failed with:

Impossible to connect, please check your Algolia Application Id.

Logged into virtual box with vagrant ssh and gave it another try.

That solved my problem.

Sebraponi
  • 21
  • 3