Search code examples
laravelpostgresqlphp-8.3

Laravel and PHP8.3 can't connect to Postgre database


I've spent quite some time on an issue with my Laravel app when upgrading to PHP8.3 and using a Postgre database, so I'm writing this to share my findings as I was not able to easliy find the answer online.

The issue was that since migrating to a new server and upgrading PHP to 8.3 in the process, my app refused to connect to my postgre database located on another server.

The error I kept getting was:

SQLSTATE[08006] [7] could not send startup packet: Resource temporarily unavailable

This lead me to believe that there is something wrong with the firewall or credentials, however everything was correct.


Solution

  • The issue ended up being the Swoole extension (php8.3-swoole). Removing this extension fixed the issue - for some reason they removed postgre support from what I understand.

    I won't post specifics on how to remove it, I suggest you use ChatGPT and find instructions for your specific platform - I was able to do so even though I'm no expert on Linux.