My PHP script gives the error 'Call to undefined function: mysql_connect()'

This error is usually caused by unecessary or incorrect directives in a custom php.ini file.

We usually find this happens when the extension_dir directive is specified within a custom php.ini file - if you are getting this error and you have a custom php.ini that has the extension_dir directive in it then please remove this line which should resolve the problem.

Using a php.ini found on other webservers or examples given on PHP-related websites will likely cause problems such as this. If this does not resolve the issue, you should contact whoever supplied the script that you are attempting to run as this may suggest a coding issue.

  • 169 Users Found This Useful
Was this answer helpful?

Related Articles

Possible issues with OSCommerce and MySQL5

We have been made aware that some customers may have issues with their OSCommerce installations...

I'm getting SQL errors on MySQL 5 saying it can't find a column - but it's there!

1054 - Unknown column 'a.c' in 'on clause'This can happen if you're doing something like:SELECT *...

My script states that the MAX_JOIN_SIZE setting in MySQL set to low. How do I increase it?

MySQL will refuse to execute select statements that process a very large number of rows. You...

I have software that requires MySQL 4 can this be provided instead of the current version.

MySQL 4 was less compliant with ANSI SQL - this was improved in version 5 and there are many...

Why am I getting a host blocked with 'mysqladmin flush-hosts' error?

Errors such as:-Host 'xxx.xxx.xxx.xxx' is blocked because of many connection errors; unblock with...