1

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

/usr/lib/php/extensions/no-debug-non-zts-20100525

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

extension=pdo_pgsql.so
extension=pgsql.so

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() 

2 Answers 2

3

Solution

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

https://github.com/Homebrew/homebrew-php

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.

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

2 Comments

Thanks! Additionally: the PDO extension can be installed with $ brew install php56-pdo-pgsql.
In fact, you can just brew reinstall php56 --with-postgresql to add support with uninstalling
0

Updating the php version worked for me:

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6

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.