I am having a problem loading MySQL through PHP on my local server.

Windows XP SP2
Apache 2.2
MySQL Server 5.0.51a
PHP 5.2.5

I have the following in my php.ini

extension_dir ="C:\Web\PHP\ext\"
extension=libmySQL.dll

I copied the libmySQL.dll from the MySQL install into C:\Web\PHP\ext\".

The file structure is as follows.

C:\Web\PHP\
C:\Web\Apache2.2\
C:\Web\MySQL_Server_5.0\

The PHP and Apache loads fine and I can connect to the MySQL using the command line tool.

Any ideas why I cant get the MySQL loaded with PHP?

Thanks

I have attached the phpinfo(); below

    Thanks I have already tried that.

      I really cant find any answers to this issue 🙁

      The weird thing is I do not get any loads errors, almost like its not even trying to run the .dll

        You should be using the libmysql.dll that comes with PHP. Since you're using PHP5, it should be in the main directory where you extracted PHP to (e.g. c:\Web\PHP). This directory should then be added to your system's PATH environment variable so that PHP can find the .dll.

          bradgrafelman wrote:

          You should be using the libmysql.dll that comes with PHP

          There was no libmysql.dll in the PHP install - I reinstalled to double check 🙁

            no just the .exe installer - should I try the .zip instead?

              typical!

              I downloaded the .zip and put the php_mysql.dll in my system32 then rebooted and it worked 🙂

              Thanks Brad you got me on ther right track.

              Thanks to everyone for your replies.

              P.S. I will put this method on my site as a tutorial for installation on XP SP2, I will post a link later since I could not find decent install tutorial this may help others.

                fean0r wrote:

                and put the php_mysql.dll in my system32

                You should never move any PHP-related files outside the PHP installation directory (including any DLL files or the php.ini file)!

                  Well it did nt work until I did, Unless the new files needed a system reboot rather than just an apache reboot?

                    php_*.dll should be in the extension_dir that is defined in your php.ini file. Support .dll libraries (e.g. libmysql.dll) should be placed in the main PHP installation folder which should be added to the system's PATH environment variable.

                      Write a Reply...