PHP Install Instructions for All About Web Design Meetup
To be able to use PHP on your home computer, you need to install PHP itself and a server to run it on.
Apache is a widely used and, best of all, free server that anyone can download and install. To get PHP
working on your computer, follow steps 1, 2 and 3. And then you’ll be able to run PHP files from your
web browser (hopefully!).
Eventually, you’ll want to have a database on your computer to test the PHP interface with a database.
Typically, PHP is used with the MySQL database. Fortunately for us again, this is free and the instructions
to install it are in section 4. This is a little trickier to install, but there is good support at www.mysql.com
both in the manual and in the forum.
Good luck!
1. Install Apache Server
a. Go to http://httpd.apache.org/
b. Under “Download!” click on “from a mirror”
c. Under “Apache HTTP Server 2.2.11 is the best available version”, click on the link for
“Win32 Binary including OpenSSL 0.9.8i (MSI Installer)”
d. You can either Run or Save the file.
i. If you save it, remember where you saved it.
ii. Go to where you saved it and click on it to run it.
e. Run the installer. Choose “Typical” installation
f. That’s about it. This one is pretty easy.
2. Install PHP
a. Go to http://www.php.net
b. Click on “downloads” at the top
c. Click on “PHP 5.2.9-2 installer” under “Windows Binaries”
d. Click on one of the links under the “United States”
e. You can either Run or Save the file.
i. If you save it, remember where you saved it.
ii. Go to where you saved it and click on it to run it.
f. Run the installer.
g. When it asks, select “Apache2.2.x Module”
h. Your “Apache Configuration Directory” will probably be “C:\Program Files\Apache
Software Foundation\Apache2.2\conf\” – click on “Browse” and find your way there
i. Click on “Extensions” and “Extras” to install them on your hard drive
j. Click “Install”
3. Configure files (these assume you used the default installation locations)
a. Apache
i. Go to C:\Program Files\Apache Software Foundation\Apache2.2\conf
ii. Open the httpd.conf file (it may show as only httpd described as a text
document)
iii. Find a long list of lines that start with “LoadModule” and add the following
below that:
LoadModule php5_module "c:/program files/php/php5apache2_2.dll"
iv. Find a list of lines that begin with “AddType” and add the following:
AddType application/x-httpd-php .php
v. Find the line that starts with “DocumentRoot”.
1. This is the folder where you need to put your web files (especially
anything with PHP for the server to run them.
2. You can use the default or you can change this to whatever you want.
C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
3. Save and close the file.
vi. Click on the Apache icon in your system tray (bottom right, near the time) – it
looks like a feather with an arrow in a circle – and click on “Restart”
1. This allows the changes you made to take effect.
b. PHP
i. Go to C:\Program Files\PHP
ii. Open the php.ini file (it may show as only php described as a Configuration
Settings)
iii. Find the line that begins with “doc_root” and, if it’s not already, set it to the
same location you set as “DocumentRoot” in the Apache file:
C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
iv. Save and close the file.
4. Install MySQL (Optional)
a. Go to http://www.mysql.com
b. Sign up for an account (it’s free)
c. Click on Downloads in the Orange bar at the top
d. Click on Download under “MySQL Community Server”
e. Choose the version that you need.
i. Probably “Windows MSI Installer (x86)” – click on “Pick a Mirror”
f. Fill out the information that they request (if they do)
g. Wait for confirmation…
h. Once you get confirmation (mine only took one day), repeat steps a through e (repeated
here for your convenience.
i. Go to http://www.mysql.com
ii. Sign up for an account (it’s free)
iii. Click on Downloads in the Orange bar at the top
iv. Click on Download under “MySQL Community Server”
v. Choose the version that you need.
1. Probably “Windows MSI Installer (x86)” – click on “Pick a Mirror”
i. Login using your account information.
j. Choose a mirror.
i. Click on the “HTTP” next to whichever one you want.
k. You can either Run or Save the file.
i. If you save it, remember where you saved it.
ii. Go to where you saved it and click on it to run it.
iii. If you try to save it and it won’t run, then try running it immediately after
download.
l. Let the installer run. I chose the “Typical” installation.
m. Let the installation complete.
n. Leave “Configure the MySQL Server now” option checked and click “Finish”
o. In the next wizard:
i. Choose “Detailed Configuration” , then click “Next”
ii. Choose “Developer Machine” , then click “Next”
iii. Choose “Multifunctional Database” , then click “Next”
iv. Click Next.
v. Leave “Decision Support (DSS)/OLAP” selected and click Next
vi. Leave “Enable TCP/IP Networking” and “Enable Strict Mode” checked. Write
down the port number for future use and if you run a firewall, check “Add
firewall exception for this port”, then click “Next”
vii. “Standard Character Set” is probably OK, but change it if you want to support
other languages, then click “Next”
viii. Check “Install as Windows Service”, then click “Next”
ix. Enter a password for access to your MySQL
1. Remember this so you can get back in if you need to adjust anything
later
2. then click “Next”
x. Click “Execute”