0

I'm trying to connect to a PostgreSQL via a PHP script which runs on MAMP local server for Windows:

$db = new PDO("pgsql:host=localhost;dbname=dbName", "user", "password");

This throws an error "could not find driver"

So I looked for ";extension=pdo_pgsql" and ";extension=pgsql" in the php.ini file, and removed the ";". Saved and restarted the MAMP's local server.

enter image description here

enter image description here

enter image description here

Unfortunately, PDO_PGSQL still doesn't appear to be loading

enter image description here

I don't have any of these problems on the MacOS version of MAMP. Am I missing some extra steps?

1 Answer 1

1

I had the same problem
export PATH=/Library/PostgreSQL/10/bin:$PATH worked for me

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.