Jump to content

Getting MySQL to work with PHP


eddy556

Recommended Posts

Okay I've had this problem for a while and I have done absolutely everything I can find on the internet about this.  I have PHP version 5.2.3 and MySQL Server 5.0 both installed and working fully independently of each other...however I just cannot get them to work together.  I have downloaded both libmysql.dll and php_mysql.dll and both are located in the folder C:\Program Files\PHP. I have also updated php.ini correctly (i think anyway) but just to check here are the affected lines:

 

extension_dir = "C:/Program Files/PHP/"

extension=php_mysql.dll

 

I have also changed the PATH variable in the windows environment variables so at the end I have: C:\Program Files\PHP\ with a semi-colon before the previous entry...and restarted afterwards.

 

I can't figure out the problem at all...there is no mention on MySQL when I call the function phpinfo()

 

Hopefully one of you know whats going on! I'm sure there's a simple solution :-)

Link to comment
Share on other sites

Is PHP reading your php.ini?

 

Check the following two lines:

Configuration File (php.ini) Path

Loaded Configuration File

 

When you run phpinfo().

 

One of those should be set to the full path in which php is reading your php.ini from, eg if you php.ini is in C:/Program Files/PHP/ then one either of the above lines should be set to C:/Program Files/PHP/php.ini

 

if none of them is set the correct path then PHP is not reading your php.ini

Link to comment
Share on other sites

Okay this is what I have:

 

Configuration File (php.ini) Path C:\WINDOWS

Loaded Configuration File C:\Program Files\PHP\php.ini

 

Should the path be C:\WINDOWS?  I am pretty sure php.ini is being read correctly as I can turn of error reporting and the effects take place after restarting the server...but I don't understand why C:\WINDOWS is showing up?

Link to comment
Share on other sites

Okay just found this error:

 

PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Program Files/PHP/php_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0

 

and this is repeated twice...however I have checked and double checked that the file is in the correct place

Link to comment
Share on other sites

Okay just found this error:

 

PHP Warning: PHP Startup: Unable to load dynamic library 'C:/Program Files/PHP/php_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0

 

and this is repeated twice...however I have checked and double checked that the file is in the correct place

PHP requires an third party library in order for php_mysql.dll to function correctly. This external library is called libmysql.dll. Make sure this file is in the root of the PHP folder.

 

Also delete any instance of libmysql.dll form your computer, but keep libmysql.dll in PHP and MySQL's installation directory only.

Link to comment
Share on other sites

Okay so here's my understanding of what I'm meant to do...

 

I have just realised there is a file libmySQL.dll in the bin folder of my MySQL installation.  Am I meant to copy this file to my PHP root directory?  Previously I was using a libmysql.dll which I just downloaded off the net and its around half a MB smaller than the one in the MySQL bin folder.  Also do I leave the original file in place?  I have tried this and restarted the server but it has still not worked with the same error.  Would it help to upload my php config file?  Does the MySQL folder need a PATH variable?

 

Thanks :-)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.