Make sure that Postgresql extension is available for you.
You can run
phpinfo();, which will give you a lot of information, including all the available extensions. Look for section
pgsql which has line items similar to these:
PostgreSQL Support enabled
PostgreSQL(libpq) Version 7.4.8
... ... ... ...
Or you can execute this code:
-
-
echo extension_loaded('pgsql');
-
which will print 1 if you have pgsql library available on your server.