This question already has an answer here:

I'm trying to connect my PHP page to MySQL database, but I'm getting this error :
PHP Fatal error: Call to undefined function mysql_connect()
I'm working on Ubuntu 11.10 MySQL 5.5 and PHP 5.3. I have also installed the apache2 server, and it works fine. I tried to install the php5-mysql module using the following command:
sudo apt-get install php5-mysql
I get this error :

The following packages have unmet dependencies:
 php5-mysql : Depends: php5-common (= 5.3.6-13ubuntu3.1) but 5.3.6-13ubuntu3.9 is to be installed
E: Unable to correct problems, you have held broken packages.  

I tried to install php5-common again but nothing was successful.

marked as duplicate by Eliah Kagan, Kevin Bowen, Eric Carvalho, Basharat Sialvi, Tom Brossman Jul 4 '13 at 18:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


How do I resolve unmet dependencies after adding a PPA?. The answer here may help. Especially the section about sudo apt-get -u dist-upgrade


php5-mysql : Depends: php5-common (= 5.3.6-13ubuntu3.1). This means that php5-mysql was looking for php5-common (=5.3.6-13ubuntu3.1) but I had php5-common (=5.3.6-13ubuntu3.9) installed. I removed the package php5-common (=5.3.6-13ubuntu3.9) which is when the default php5-common (=5.3.6-13ubuntu3.1) was there. I reinstalled the other packages which got removed when I removed php5-common with the following command
sudo apt-get install php5-cli
sudo apt-get install php5 libapache2-mod-php5
sudo apt-get install php5-mysql
and restarted apache2. Now it works fine.

Not the answer you're looking for? Browse other questions tagged or ask your own question.