Can't stop making
Home

Apache 2.2, PHP 5.3, MySQL and PDO setup with Windows 7

  1. Download PHP 5.3 (as of writing latest is 5.3.8): http://windows.php.net/download/
  2. Download MySQL MSI Installer (32bit/64bit up to you): http://www.mysql.com/downloads/mysql/
  3. Download Apache 2.2 MSI Installer with OpenSSL (as of writing latest is 2.2.19): http://httpd.apache.org/download.cgi#apache22
  4. Unzip PHP to c:\php
  5. Rename php.ini-development to php.ini, open it and customise it as you see fit
    1. Remember to enable PDO extentions as well as the standard mysql extension
    2. Ensure you have: extension_dir = "C:\php\ext" and not just "ext"
  6. Install MySQL and go through the setup procedure
  7. Install Apache 2.2 and open the httpd.conf file (you should find the shortcut to the file in program files)
    1. Setup the httpd.conf as you like.
    2. 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"
  8. Click the Start Menu icon, right click "Computer", "Properties" to get the System control panel up.
    1. Click "Advanced system settings" on the left to up up "System Properties" window in the "Advanced" tab
    2. 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)
    3. Reboot computer
  9. Once rebooted Apache should be up by itself. Check out the error log (again a shortcut should exist in your start menu)
  10. 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"
  11. That's all folks. Personally I'd also setup vhost.

標籤 tag(s)

  • PHP
  • Apache
  • MySQL
  • PDO
  • Windows

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.

  • If you see this, something's wrong with Twitter.

Blatant Plug

Need a new CPU or graphics card? Get AMD.

AMD Vision and AMD Radeon Graphics

Support

I've pledged my support to these organisations, and I think you should too.

  • Google+
  • Follow ronaldslc on Twitter
  • View Ronald Chan's profile on LinkedIn