Enable MySQL in PHP5

Forum for you who has PHP installation issues

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 40
Joined: Fri Jun 27, 2003 10:57 pm

Tue Aug 12, 2003 6:15 pm

Hi all,

Here is how you can set up MySQL in Windows machine...

I could not find any information on the net about this but thanks to the PHP manual that guided me through this setup!

I am assuming that your PHP5 is already installed and it is working.

Please go to http://snaps.php.net and download the one under Latest CVS (5.0.x-dev) for Win32 Package.

The reason is that we need a file called php_mysql.dll which is not given if you download your Windows Binaries from http://www.php.net/downloads.php.

Now, we need to edit the php.ini, which can be found in:
c:\windows for Windows 9x/Me/XP
c:\winnt for Windows NT/2000

Then, add this two lines under the "Dynamic Extensions" section:

Code: Select all

extension_dir = x:/php/extensions/

Please note that the backslash at the end of "extension_dir = x:/php/extensions/" is required!
As noted before the "php_mysql.dll" file is given under the extensions folder if your download from http://snaps.php.net

For php_mysql.dll extension, there is an extra DLL that is needed for it to work, which is libmySQL.dll

Now, do the following:

Code: Select all

copy x:/php/dlls/libmySQL.dll to 
c:\windows\system for Windows 9x/Me
c:\winnt\system32 for Windows NT/2000
c:\windows\system32 for Windows XP

(Note: The destination depends on your OS)

Note that since we are replacing your old PHP5 with the newly downloaded one, then we must remember to edit the ADDModule directive in your httpd.conf in Apache directory since you need to tell Apache to use this new PHP5.
Otherwise, if you stay with your old PHP5, you are completely ready to do your MySQL query now!

In my case, I did replace my old PHP5 with the new one just like the steps above but I am quite sure that the one obtained from php.net should work too since it just lacks a php_mysql.dll!

Good luck everyone!

New php-forum User
New php-forum User
Posts: 40
Joined: Fri Jun 27, 2003 10:57 pm

Tue Aug 12, 2003 6:18 pm

I forgot to give you all this:
http://www.php.net/manual/en/install.wi ... extensions

A very good reference for enabling extensions.

Post Reply