Had a similar error, solved it using:
When you upgrade Apache you have to install libapache2-mod-php4

Apache 2 doesn’t always automatically update the php.ini files so that the related packages can be used with Apache The solution to this is to reconfigure the php4-pgsql and php4-mysql packages with:

dpkg-reconfigure php4-pgsql php4-mysql

with a smile