Why am I getting a ’call to undefined function: mysql_connect()’ error in my PHP script?


If your script gives you a 'Call to undefined function: mysql_connect()' error, this is usually caused by unnecessary or incorrect directives in your custom php.ini file.

This can happen when you have an extension_dir directive specified within your php.ini file.  If you remove that line in your file, it should resolve the problem.

Often, using php.ini files found on other web servers or given as an example on PHP programming websites can cause problems such as this.  If removing the extension_dir directive does not fix the problem, you should contact the script programmer, as this might suggest an issue with script.



Article ID: 18
Created On: Mon, Mar 2, 2015 at 5:03 PM
Last Updated On: Thu, Apr 23, 2015 at 10:40 AM

Online URL: https://www.heartinternet.uk/support/article/why-am-i-getting-a-call-to-undefined-function-mysql_connect-error-in-my-php-script.html