1

I work on a laravel project, and I want to use Algolia search .

I'm using Laravel 5.8 , PHP 7.3.2, MySQL 5.7 , also I tried to use Algolia with plain PHP gave me the same error .

The Scout.php file :

'driver' => env('SCOUT_DRIVER', 'algolia'),
'queue' => env('SCOUT_QUEUE', true),
'algolia' => [
        'id' => env('ALGOLIA_APP_ID', 'MY-APP-ID'),
        'secret' => env('ALGOLIA_SECRET', 'MY-APP-SECRET'),
    ],

.env file :

ALGOLIA_APP_ID=MY-APP-ID
ALGOLIA_SECRET=MY-APP-SECRET
SCOUT_QUEUE = true

I double checked the values I entered as AppID and AdminID, I should be able to connect just fine , but it always says:

Impossible to connect, please check your Algolia Application Id.

I can connect and update data just fine when using Node.JS

Kenny Horna
  • 13,485
  • 4
  • 44
  • 71
Saber Hosney
  • 112
  • 1
  • 12
  • Did you check [this answers](https://stackoverflow.com/questions/55488366/how-to-fix-this-error-impossible-to-connect-please-check-your-algolia-applicat)? – azeós Jul 07 '19 at 06:55
  • I checked it, actually for god's sake the certificate solution worked , seems that I was adding the location to the cert. incorrectly . if you post it as answer I could mark it . – Saber Hosney Jul 07 '19 at 08:46
  • Just answering because the other question doesn't have a selected answer. But this is a duplicated question, so I'm gonna flag it. Give the original author an upvote, this might gonna get closed. – azeós Jul 07 '19 at 09:03
  • Possible duplicate of [How to fix this error "Impossible to connect, please check your Algolia Application Id"?](https://stackoverflow.com/questions/55488366/how-to-fix-this-error-impossible-to-connect-please-check-your-algolia-applicat) – azeós Jul 07 '19 at 09:03
  • @azeós yes this is a duplicate , but this one provide better explanation and a direct answe that really solves the problem , or if Moderators can approve the answer on the original post so people don't struggle around – Saber Hosney Jul 07 '19 at 14:47

1 Answers1

3

I'm just quoting another answer on SO: How to fix this error “Impossible to connect, please check your Algolia Application Id”?. Full answer there, just quoting the relevant parts:

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!!!

Author: @Anthem.

azeós
  • 4,853
  • 4
  • 21
  • 40