So that I know of, PHP CLI in Ubuntu 8.10 is broken when you use the pgsql module in PHP. While I don't know the reason why exactly, I do know this has something to do with the curl module loading before pgsql. Whilst this issue hasn't been patched in PHP 5.2 nor in PostgreSQL 8.3 or 8.4 for that matter - there is an easy enough workaround in the mean time to get it working:
You should have a PHP conf directory located in /etc/php5/conf.d and in there are your modules that get loaded. Open up pgsql.ini and comment out the line that says 'extension=pgsql.so' by adding a '#' to the front of the line. This will stop PHP from loading the extension by loading this file. Next, we what to add the very line we commented out to the curl.ini file BEFORE the curl.so extension is loaded.
Once you've don that, CLI should work a treat, PHP through Apache will be unchanged.
Happy coding :)


thank you, thank you, thank
thank you, thank you, thank you, thank you :)
been puzzled as to why i could not run drush on my debian etch with postgres 8.3 for months. you trick did it :)
Same fault on debian lenny.
Same fault on debian lenny.
Same fault on debian
Same fault on debian lenny.
Another way to fix this is to do
mv /etc/php5/cli/pgsql.ini /etc/php5/cli/0-pgsql.ini
So nice comments, I try to
So nice comments, I try to add it in my brouse. Thank you
Sensational, this was doing
Sensational, this was doing my head in, good work!
Thanks!!!! I had the very
Thanks!!!! I had the very same issue and your fix works perfectly!
Post new comment