Apache 2.2, PHP 5.3, MySQL and PDO setup with Windows 7
- Download PHP 5.3 (as of writing latest is 5.3.8): http://windows.php.net/download/
- Download MySQL MSI Installer (32bit/64bit up to you): http://www.mysql.com/downloads/mysql/
- Download Apache 2.2 MSI Installer with OpenSSL (as of writing latest is 2.2.19): http://httpd.apache.org/download.cgi#apache22
- Unzip PHP to c:\php
- Rename php.ini-development to php.ini, open it and customise it as you see fit
- Remember to enable PDO extentions as well as the standard mysql extension
- Ensure you have: extension_dir = "C:\php\ext" and not just "ext"
- Install MySQL and go through the setup procedure
- Install Apache 2.2 and open the httpd.conf file (you should find the shortcut to the file in program files)
- Setup the httpd.conf as you like.
- Add the following to the bottom of httpd.conf:
# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"
- Click the Start Menu icon, right click "Computer", "Properties" to get the System control panel up.
- Click "Advanced system settings" on the left to up up "System Properties" window in the "Advanced" tab
- Click "Environment Variables", either in User or System's list find the PATH variable and add "c:\php;" to the start of the line (or ";c:\php" to the end)
- Reboot computer
- Once rebooted Apache should be up by itself. Check out the error log (again a shortcut should exist in your start menu)
- Make sure there are no PHP startup errors. If you get errors about extensions unable to load, make sure you have:
extension_dir = "C:\php\ext" - That's all folks. Personally I'd also setup vhost.
Version
Apache 2.2.x, PHP 5.3.x
Last Updated
25th August, 2011
First Published
25th August, 2011
Comments
Leave a comment
Any published comments will adhere to the etiquette policy and all e-mail addresses will be treated in accordance to the privacy policy.
Me in real-time
- If you see this, something's wrong with Twitter.
Blatant Plug
Support
I've pledged my support to these organisations, and I think you should too.






