问题
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.
回答1:
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.
回答2:
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.
回答3:
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.
来源:https://stackoverflow.com/questions/55488366/how-to-fix-this-error-impossible-to-connect-please-check-your-algolia-applicat