PHP Fatal error: Call to undefined function mysql_connect()
Description
When executing a PHP script which is trying to access a MySQL database, the program fails fatally with the following message:
PHP Fatal error: Call to undefined function mysql_connect()
Resolution
The MySQL libraries probably haven’t been installed for PHP. These aren’t installed by default. This is done on two distributions with the following commands:
Ubuntu:
sudo apt-get install php5-mysql
Fedora:
sudo yum install php5-mysql