PHP broken after upgrading to php 5.4

Solution 1:

Installing newer PHP versions on Ubuntu machines that doesn't support them is not recommended.

If you really need, you should try installing the PHP and MySQL packages from DotDeb, which has all of the extensions built as well. Instructions on their website http://www.dotdeb.org/instructions/

If installation asks for newer versions of your libs, you can download them from http://packages.debian.org and install them manually using dpkg -i packagename.deb.

Note that this can ruin your Ubuntu installation. Test this on a Virtual Machine or recoverable environment, never in production.

Solution 2:

Have you tried to restart your webserver?

sudo /etc/init.d/apache2 restart

Haven't used Ubuntu in a while but I believe that's it

and then after that try re installing the packages in question. The MySQL ones

Solution 3:

Ubuntu 12.4 is still beta phase ( final beta ) as far as i know. Since libmysqlclient16 has been removed from Ubuntu 12.04 repos you will need to install it manually. Download packages: 32 bit version - http://launchpadlibrarian.net/94563300/libmysqlclient16_5.1.58-1ubuntu5_i386.deb 64 bit version - http://launchpadlibrarian.net/94808408/libmysqlclient16_5.1.58-1ubuntu5_amd64.deb

and then install it with: sudo dpkg -i libmysqlclient16_5.1.58-1ubuntu5_XXX.deb Probably you will need to upgrade your mysql server to 5.1.58

Solution 4:

I have this problem as well on Debian Testing/Wheezy. I have no idea why the extensions are being installed to /usr/lib/php5/20100525/, but it seems that's where they are. To fix it, open up your php.ini file wherever that may be (probably in /etc/php* or something) and modify/add the following line:

extension_dir = "/usr/lib/php5/20100525/"

Then restart your php5-fpm if you know how, or just reboot the machine and PHP should be working again.