Fatal error: Call to undefined function mysql_connect()

When PHP is not compiled with Mysql, you receive ‘Call to undefined function mysql_connect’ error message on your website

Fatal error: Call to undefined function mysql_connect()
 in filename.php on line xx

In order to fix the issue, install the “php-mysql” package using yum

# yum install php-mysql

Once installed, restart the httpd service

# service httpd restart

To verify if the package is installed properly, execute

# php -i | grep mysql
This entry was posted on Sunday, May 2nd, 2010 and is filed under Linux Administration. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.