I'm attempting to configure MySQL for use with PHP and Apache. But obtaining the following error. I don't know how to proceed.

Fatal error: Call to undefined function mysql_connect()

Please explain what exactly are steps to configure MySQL with PHP and Apache. What changes are needed within the .ini and .dll files.

I'm while using following versions:

  • Apache: 2.2.19
  • PHP: 5.3.8
  • MySQL: 5.5.15

I'm using Home windows machine.

In php.ini, uncomment the road: ;extension=php_mysql.dll

do you have install the mysql extension for php?

Possibly not quite the solution you are searching for but have you thought about using XAMPP? This is an installer for your exact setup (apache + php + mysql).


If you are using home windows, I suggest using WAMP to setup your server - http://www.wampserver.com/en/.

Much faster than fighting this kinda fight yourself.

FWIW, try looking in (I believe) PHP.ini there is a lengthy listing of libraries that are all said out automatically. MySQL support is one uncomment, restart apache, repeat the process. What they are called are fairly apparent, though from memory you will find 2 MySQL ones.

I discovered this link to every explanation: http://www.artfulsoftware.com/php_mysql_win.html