Archive for PHP related

Call to undefined function pg_connect() when php5-pgsql is installed

if you are getting “Call to undefined function pg_connect()” error firstly, you must install php5-pgsql in order to pg_connect function can be accessible from PHP. But you are still getting the same error, after installing php5-pgsql then you can solve the problem by adding

extension=pgsql.so

to the end of your php.ini file and restarting Apache.