3

I am trying to configure MySQL to be used with PHP and Apache. But getting the following error. I am not sure what to do.

Fatal error: Call to undefined function mysql_connect()

Please explain what are steps to configure MySQL with PHP and Apache. What changes are required in the .ini and .dll files.

I am using the following versions:

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

I am using Windows machine.

4 Answers 4

3

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

Sign up to request clarification or add additional context in comments.

Comments

0

have you got install the mysql extension for php?

3 Comments

No I didn't install mysql extension for PHP.
you mean the DLL files in PHP extension directory? If yes then I have those DLL files.
phpinfo() showing one table with heading mysqlnd. There is no other table related to MySQL
0

Perhaps not exactly the answer you're looking for but have you considered using XAMPP? It's an installer for that exact setup (apache + php + mysql).

http://www.apachefriends.org/en/xampp.html

1 Comment

Thanks for the comment. I have used XAMPP earlier but right now I want to use Apache only.
0

If you're using windows, I recommend using WAMP to set up your server - http://www.wampserver.com/en/.

Much quicker than fighting this kinda battle yourself.

FWIW, look in (I think) PHP.ini; there's a long list of libraries which are all commented out by default. MySQL support is one of them; uncomment, restart apache, try again. The names are fairly obvious, though from memory there are 2 MySQL ones.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.