jckhan jckhan - 5 months ago 16x
PHP Question

PHP not loading postgresql extensions ( mac os x)

my currently extension folder in php is ( executing php-config --extension-dir)


Inside this directory i have my postgresql extensions that i need to load

-rwxrwxrwx 1 root wheel 32940 Feb 25 17:12 pdo_pgsql.so
-rwxrwxrwx 1 root wheel 135652 Feb 25 23:55 pgsql.so

On the php.ini that is shown by phpinfo() i have this lines uncommented


Php and postgre were installed with brew.
And i "make" both pgsql.so and pdo_pgsql.so with the php source files corresponding to my actual version which is 5.6.5

Every time i call pg_connect it shows me a fatal error

Fatal error: Call to undefined function pg_connect()



The version i had wasn´t built with the --with-postgresql option in brew so i uninstalled the php56 and then reinstalled it with the option mentioned before following all the instructions


You can get the post installation insctructions with brew info php56 in my case.

With the php built with postgresql you don´t need to add the pgsql.so and pdo_pgsql.so extensions in the php.ini file.