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

skye1985's avatar

Postgres authentication error SCRAM libpq

I switched to MAMP + Postgres as stack for my local developement of Laravel, because my valet configuration was broken after last update (no resolution found for now... sigh). My configuration is:

  • Laravel 8.12
  • PostgreSQL 15.4

Now when i try to login (endpoint .../api/login) i recieve this error:

Illuminate\Database\QueryException: SQLSTATE[08006] [7] SCRAM authentication requires libpq version 10 or above (SQL: select * from "users" where "email" = admin@ereditaculturali limit 1) in file /Users/vincenzobologna/valet/ereditaculturali/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 712

How can i try to resolve? any suggestions? thanks in advance!

0 likes
4 replies
rashid_khitilov92's avatar

I have also problem like this SQLSTATE[08006] [7] SCRAM authentication requires libpq version 10 or above

skye1985's avatar
skye1985
OP
Best Answer
Level 1

I finally found a solution to my problem, and I want to share to anyone can be fall to this pit:

In /usr/local/etc/php/8.2/php-fpm.d/www.conf after the following:

; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp

Add an environment variable like this:

env['PGGSSENCMODE'] = disable

Then restart php. This will work even after a reboot.

softmixt's avatar

I had same issue using Mac Intel with Docker what I've done is :

  1. Download the latest library in your Mac: brew install libpq
  2. Copy entire lib folder from /usr/local/opt/libpq/lib into /Applications/MAMP/Library/pg/lib you can just rename /Applications/MAMP/Library/pg/lib into /Applications/MAMP/Library/pg/lib_BK just in case.
  3. Restart php or server and try again php artisan migrate it should work .
2 likes

Please or to participate in this conversation.