I have a laravel app on nginx with postresql
php artisan migrate
throws error:
In Connection.php line 671:
SQLSTATE[08006] [7] received invalid response to SSL negotiation: b (SQL: select * from information_schema.tables where table_schema = publ
ic and table_name = migrations and table_type = 'BASE TABLE')
In Connector.php line 70:
SQLSTATE[08006] [7] received invalid response to SSL negotiation: b
FILES:
.env
...
DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=secretdbname
DB_USERNAME=secretusername
DB_PASSWORD=secretpassword
...
postresql.conf ...
port = 5432
...
in php.ini enabled:
pgsql
pdo_pgsql
mbstring
php -m
...
mbstring
openssl
PDO
pdo_mysql
pdo_pgsql
pgsql
...
Appropriate db exists, user exists and has got all the privileges. Postgres service is active. DB and app are located on the same server.
What I have tried:
I have SSL certificate with certbot.
I would appreciate some hint on how to solve the above error.
I got the same error today with the Laravel 9.
The solution was to make sure the Postgress DB_Port inside .env is pointing to 5432.
Hope it will help others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With