Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Abrahamghaemi's avatar

received invalid response to SSL negotiation

change database config to pgsql and migreated get error. i use laravel homestead lasted version.

[Illuminate\Database\QueryException]                                                             │(0 rows)
  SQLSTATE[08006] [7] received invalid response to SSL negotiation: [ (SQL: select * from inform   │
  ation_schema.tables where table_schema = public and table_name = migrations)

``

```sh 

  [PDOException]                                                                                   │----+-------+------
  SQLSTATE[08006] [7] received invalid response to SSL negotiation: [ 


``
0 likes
5 replies
pedroskakum's avatar

I have the same problem, more specific in a Forge with postgres and Laravel 5.4.

Can someone help us?

IBRAHEM, have you solved the problem?

1 like
scottmcclung's avatar

Whenever I've run into this error it is usually because I've changed the DB driver in my .env file to pgsql but forgot to change the port to 5432

32 likes
aboozar's avatar

Just make sure you have changed the DB port too. This error often occurs when you have changed all DB configs to Postgres but the default port config remains as 3306 which is MySQL port.

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432  <-- This should change to your postgres port

or disable it in your config/database.php file from 'prefer' to 'disable'

sslmode = 'disable'

Other possible values for sslmode are 'disable', 'allow', 'prefer', 'require', 'verify-ca', 'verify-full'

7 likes

Please or to participate in this conversation.