Linux – PHP broken after upgrading to php 5.4

lamplinuxPHPUbuntu

on an ubuntu 12.04 i have upgraded to PHP 5.4 according to this tutorial
http://www.upubuntu.com/2012/03/how-to-upgrade-install-php-540-under.html
But when i call php5 -v i get

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/mysql.so' - /usr/lib/php5/20100525/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/mysqli.so' - /usr/lib/php5/20100525/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/pdo_mysql.so' - /usr/lib/php5/20100525/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.4.0-3~lucid+4 (cli) (built: Mar 27 2012 08:55:12) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

how can i fix it without breaking more stuff? 😉

edit,
when trying to install php5-mysql

sudo apt-get install php5-mysql

i get

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php5-mysql : Depends: libmysqlclient16 (>= 5.1.21-1) but it is not installable
E: Unable to correct problems, you have held broken packages.

Best Answer

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.