Now that we have installed PHP 5 on IIS 7 successfully, we’re going to install MySQL Server 5.1.
- First of all, get yourself a copy of the MySQL Server 5.1 ZIP Setup from http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.22-rc-win32.zip/from/pick#mirrors
- Extract all the files from the archive and launch Setup.exe
- I’ve chosen to use the Typical Setup but feel free to customize the installation to suit your needs.
- Once the installation is completed, leave the checkbox Configure the MySQL Server now checked and go through the Detailed Configuration.
- I’ve selected Server Machine as the server type and Multifunctional Database usage but again set this as you prefer.
- I’ve also left all the default settings until the Windows Options window where I’ve checked Include BIN directory in Windows Path.
- Set the root password and you’re done.
Your MySQL Server should now be running. If you want to manage it, you can download and install the MySQL GUI Tools.
Configuring PHP5 to Access MySQL Server
- Open c:\php\php.ini with your favorite text editor.
- Uncomment the following lines by removing the semi-colon:extension=php_mysqli.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
- Restart the IIS service: Start => Programs => Administrative Tools => Services => World Wide Web Publishing Service => Restart
If all went well, you should see the mysqli section on the PHP information page created earlier (http://your-server/phpinfo.php).

13 responses so far ↓
1. Response by : Jenley on Mar 14, 2008 at 4:29 pm
downloaded mysql-5.1.23-rc-win32.zip.
Ran set, configure sql server now…..nothing.
ran wizard manully, error.
[Window Title]
C:\Program Files\MySQL\MySQL Server 5.1\bin\MySQLInstanceConfig.exe
[Content]
C:\Program Files\MySQL\MySQL Server 5.1\bin\MySQLInstanceConfig.exe
The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.
[OK]
Idea please??
2. Response by : Vladimir on Mar 27, 2008 at 11:44 pm
Hi!
Take a look here for solution:
http://forums.mysql.com/read.php?11,195569,195569
3. Response by : How To Install Your Own Web Server - Installing MySQL 5 on Jun 3, 2008 at 5:41 am
[...] If you’re about to install MySQL on MS Windows Server 2008, I suggest you read my post here. [...]
4. Response by : jose on Aug 15, 2008 at 1:42 pm
I cannot see the mysqli section when I go to my php site. I followed the directions in this post exactly. any ideas? (I’m running Win Server 2008 with IIS on a vmware vm; sitting on a win 2003 server os)- Jose
5. Response by : Stephane Brault on Aug 15, 2008 at 1:47 pm
Hi Jose,
Try copying libmysql.dll (do a search) to c:\windows\system32 and restarting IIS.
6. Response by : Mike on Sep 25, 2008 at 2:13 pm
I installed Apache and PHP on my Windows 2008 and both work, when I install MySQL, I am not able to get it to be recognized by PHP (the MySQL info does not appear in the PHP info page). I have tried multiple forums and even used the steps that I followed to get MySQL working under XP. Any idea on how to get PHP to recognize MySQL? I did verify that MySQL is working by creating a test database from the command line and it worked.
7. Response by : Stephane Brault on Sep 25, 2008 at 2:26 pm
Hi Mike,
Here are a few things you need to verify:
1. Make sure PHP uses the right php.ini file. Sometimes people make changes to c:\php\php.ini while PHP looks for php.ini in c:\windows. See your phpinfo page for this information.
2. Make sure that “extension=php_mysql.dll” is uncommented in php.ini
3. Verify that libmysql.dll exists in c:\windows or c:\windows\system32
4. Have a look at IIS’ log files, you might find additional information regarding MySQL + PHP.
Let me know if this helps you out!
8. Response by : Miki Szikszai on Oct 2, 2008 at 10:42 pm
Hi
Do you know if these instructions for IIS7, PHP and MySQL will operate on a 64bit windows server?
Cheers
Miki
9. Response by : Miki Szikszai on Oct 8, 2008 at 6:46 am
Great instructions – thanks – easy to follow and all good
10. Response by : Dana on Jan 23, 2009 at 11:49 pm
I’ve downloaded the following file and installed it. mysql-5.1.30-win32. However I’m not getting the mysqli section in the phpinfo.php page.
Anythoughts or suggestions greatly appreciated.
11. Response by : Dana on Feb 11, 2009 at 10:30 pm
I finally got the mysql section to show up on my phpinfo page. I had to remove the quotes around the extension_dir = c:\php\ext entry in php.ini
12. Response by : Ed on Oct 27, 2009 at 2:26 am
This is a great resource.
I had to do the following extra to make it work on 64bit Windows Server 2008 standard.
If you’re getting…
“HTTP Error 404.17 – Not Found – The requested content appears to be script and will not be served by the static file handler.”
on 64bit, but the ISAPI DLL is a 32-bit DLL, so you’ll have to either change your default Application Pool to enable 32-bit, or preferably create a separate 32-bit AppPool for your PHP Application.
Right click on the Application Pool and select “Advanced Settings” then “Enable 32-bit Applications.”
13. Response by : Simon on Feb 25, 2010 at 3:41 am
Yes, a really great resource.
In my case, I also had to copy libmcrypt.dll to C:\Windows directory for mysqli section to show up in PHP information page. I’m using 64 bit Windows 2008 Server.
Leave a Comment