20080522

Call to undefined function pg_connect()

When using coolstack and trying to connect to postgresql database from php script the following error appear:

Call to undefined function pg_connect() in somescript.php on line XX

The reason is default php configuration; php.ini doesn't know anything about postgresql extension, only mysql (finally, it's Solaris AMP - Apache MySQL PHP). To resolve the undesirable behaviour add:

extension="pgsql.so"

to php.ini configuration.


Cool Stack 1.2
Default file location:
/opt/coolstack/php5/lib/php.ini
/opt/coolstack/php5/lib/php/extensions/no-debug-non-zts-20060613/pgsql.so

No comments: