Jump to content

[SOLVED] MySQL and PHP on Apache


eddy556

Recommended Posts

Hi,

 

Here is my system config:

 

Apache 2.2.4 (Win32)

PHP 5.2.3

MySQL 5.0.45 Community Edition (GPL)

 

I cannot for the life of me get PHP and MySQL to interact with each other, here are the steps I have taken so far:

 


  • Edited PHP.ini
    • Changed the extension_dir = "C:\Program Files\PHP\extensions\" to the path where my extensions are
    • Uncommented the line: extension=php_mysql.dll

 

I have checked that both php_mysql.dll (36KB) and libmysql.dll (1484KB) are in the folder C:\Program Files\PHP\extensions and that this folder has been referenced in the PATH variable in environment variables (and server restarted).

 

The error message that keeps getting returned is:

 

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

 

Any ideas?  I have been trying to fix this for months now  ::)

Link to comment
Share on other sites

The path to the php root folder needs to be added to the Windows path statement. In your case - C:\Program Files\PHP

 

The path to the extension folder does not need to be added to the Windows path statement.

 

There are some auxiliary dll's that mysql uses that are in the php root folder, but the programmers forget to add unique error messages to tell you that the problem is due to not finding a different file.

Link to comment
Share on other sites

Okay, I have referenced the root PHP folder in the PATH and restarted my machine.  To ensure this has worked I have copied to path below from phpinfo():

 

C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\PHP;

 

This, from what I can see, should be okay.  However the error still occurs.  I may be missing one of the auxiliary dlls?

Link to comment
Share on other sites

I just reread your first post.

 

What method did you use to get php? The .zip package or the .msi installer? Everyone who I have seen use the .msi installer has had problems.

 

When you unzip the php .zip package the extension dll's are in a folder named "ext". There is no need to do anything other than move the whole resulting php folder to where you want it.

 

The libmysql.dll should have been in the php root folder.

 

I recommend reading wildteen88's and my posts in this thread - http://www.phpfreaks.com/forums/index.php/topic,189883.0.html

Link to comment
Share on other sites

Your posts really helped! Thanks!

 

The problem is completely sorted now, it appears I was just missing some extra dlls.  I just copied them all from the ext folder of the download....I'm guessing I did use the msi to install PHP.

 

Thanks alot :D

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.