Symptoms
Errors related to "mysql_connect" typically indicate that the script is outdated. Here's an example of the error:
CONFIG_TEXT: PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/user/public_html/script.php:7
Cause
This error is caused by the use of a modern PHP version on a website that uses the function, "mysql_connect" which was deprecated in PHP 5.5 and removed in PHP version 7.0. For more information, please review the official documentation at the following link:
Resolution
It is recommended that the website developer review all of the PHP files and update the website code, "mysql_connect" should be replaced with "mysqli_connect." to be compatible with a supported PHP version:
What versions of PHP does cPanel support?
If this is not possible, the website's PHP version can be changed to use an older version that supports mysql_connect, such as PHP version 5.4. You may be able to use PHP 5.6, but you may see deprecation warnings.
cPanel now offers the Tuxcare ELS PHP licence which can be purchased to install hardened versions of legacy PHP versions:
How do I install the older PHP versions from ELS PHP?
The following article explains how to change PHP version for a domain:
Comments
0 comments
Article is closed for comments.