How to Install the PHP Engine on Your Windows PC
If you haven’t done so already, download the PHP Windows Binaries - You can download the software from the PHP.net website, (http://www.php.net/downloads.php) Be sure to download PHP 5.2.9 installer Windows installer and PHP 5.2.9 zip package., On...
Step-by-Step Guide
-
Step 1: If you haven’t done so already
(Note: the version numbers might be different).
Save the files on your Windows Desktop. , Once you've done that, you should see a window that looks like this:
PHP Install Window ,,,,, Change the destination directory to "C:\Server\PHP".
There is no need for a trailing backslash.,,,, This will be used as the "From:" email address when using PHP's mail function., Then click "Next>"., Since you have installed Apache, pick "Apache" from the list.
Then click "Next>".,,,, Click "OK".
When the PHP installer window pops up, click "OK" again. ,,, This will normally open the file in Notepad, unless you use a different program.,, Hit "Enter" after the last line to ensure there is one blank line at the end of the file.,,,,,, This moves the "php.ini" file from the Windows directory to the PHP directory., (Note: the version number might be different).,,,,,,,,,,, This should restart the Apache server.
Now we need to create a test PHP to see if everything is working.,, Save this file in the directory "C:\Server\Apache2\htdocs" as "phpinfo.php".
Notepad has a bad habit of adding .txt to the end of all documents you save, so make sure from the "Save" dialog that comes up in Notepad, change "Save as type" from "Text Documents (*.txt)" to "All Files".
Now click the "Save" button to save your new PHP document., In the address bar, type "http://localhost/phpinfo.php".
If everything is set up correctly, you should see a page that looks like this: -
Step 2: download the PHP Windows Binaries - You can download the software from the PHP.net website
-
Step 3: (http://www.php.net/downloads.php) Be sure to download PHP 5.2.9 installer Windows installer and PHP 5.2.9 zip package.
-
Step 4: On your Windows Desktop
-
Step 5: double click the PHP installer file.
-
Step 6: Click "Next>".
-
Step 7: On the next window
-
Step 8: click "I Agree".
-
Step 9: On the next window
-
Step 10: click the radio button "Advanced"
-
Step 11: and click "Next>".
-
Step 12: We're going to install PHP in our server directory instead of the default PHP directory
-
Step 13: so in the "Destination Folder" group
-
Step 14: click "Browse".
-
Step 15: A browser window will open.
-
Step 16: Click "OK" on the browser window
-
Step 17: and then click "Next>".
-
Step 18: Select "Next>" on the next three screens.
-
Step 19: On the following window
-
Step 20: leave the SMTP defaults as they are
-
Step 21: and click "Next>".
-
Step 22: If you want
-
Step 23: you can enter an email address.
-
Step 24: On the next window
-
Step 25: make sure that the radio button "Display all errors warnings and notices" is clicked.
-
Step 26: On the next window is where you pick which web server software you are using.
-
Step 27: On the next window make sure that the check box ".php" is checked
-
Step 28: and then click "Next>".
-
Step 29: Now that you have set all the options
-
Step 30: you should see a window that looks like this: PHP Ready to Install PHP is ready to install
-
Step 31: so click "Next>" to begin the installation.
-
Step 32: If a message window pops up asking
-
Step 33: "Do you want to keep your php.ini file"
-
Step 34: click "NO".
-
Step 35: Wait for a message window to pop up
-
Step 36: that looks like this: This is normal.
-
Step 37: Now PHP is installed
-
Step 38: but we need to change some of Apache's settings to get everything working the way it should.
-
Step 39: In Windows
-
Step 40: open "My Computer"
-
Step 41: and browse your way to the folder "C:\Server\Apache2\conf".
-
Step 42: Double click the file "httpd.conf" so we can edit it.
-
Step 43: Scroll to the very bottom of the page
-
Step 44: and add these lines: ScriptAlias /php "c:/server/php/" AddType application/x-httpd-php .php Action application/x-httpd-php "/php/php-cgi.exe"
-
Step 45: Highlight and copy the text from this page
-
Step 46: and then paste it into the httpd.conf page to ensure there are no typos.
-
Step 47: Move the file "C:\Windows\php.ini" to the directory "C:\Server\php" so it’s easier to edit when you need to.
-
Step 48: Open "My Computer" and browse to "C:\Windows".
-
Step 49: Find the file "php.ini" in the windows directory.
-
Step 50: Right-click the file and pick "Cut".
-
Step 51: Browse to the directory "C:\Server\php".
-
Step 52: Right-click an empty area in the window and select "Paste".
-
Step 53: Double click the file php-5.2.9-win32.zip that is saved on your desktop.
-
Step 54: Extract the contents of this file to "C:\Server\php"
-
Step 55: Using Notepad
-
Step 56: open the file "C:\Server\php\php.ini".
-
Step 57: Find that line that reads: extension_dir = "./" (or something similar
-
Step 58: as long as its the line with "extension_dir".
-
Step 59: Change the line to: extension_dir = "C:\Server\php\ext"
-
Step 60: Find the line that reads: ;extension=php_mysql.dll Delete the ; so that the line now reads: extension=php_mysql.dll
-
Step 61: Open the directory "C:\Server\MySQL\bin".
-
Step 62: Find the file "libmysql.dll".
-
Step 63: Right-click the file and select "Copy".
-
Step 64: Browse to the directory "C:\Windows\System32" and Paste the file into that directory.
-
Step 65: Restart Apache to ensure the new lines added to the httpd.conf file have an effect.
-
Step 66: On the Windows taskbar click "Start">"All Programs">"Apache HTTP Server">"Control Apache Server">"Restart".
-
Step 67: Open Notepad (usually found in "Start">"All Programs">"Accessories">"Notepad")
-
Step 68: and copy and paste the following lines into a new document: <?php phpinfo(); ?>
-
Step 69: In Notepad
-
Step 70: click "File">"Save".
-
Step 71: Open your favorite browser.
Detailed Guide
(Note: the version numbers might be different).
Save the files on your Windows Desktop. , Once you've done that, you should see a window that looks like this:
PHP Install Window ,,,,, Change the destination directory to "C:\Server\PHP".
There is no need for a trailing backslash.,,,, This will be used as the "From:" email address when using PHP's mail function., Then click "Next>"., Since you have installed Apache, pick "Apache" from the list.
Then click "Next>".,,,, Click "OK".
When the PHP installer window pops up, click "OK" again. ,,, This will normally open the file in Notepad, unless you use a different program.,, Hit "Enter" after the last line to ensure there is one blank line at the end of the file.,,,,,, This moves the "php.ini" file from the Windows directory to the PHP directory., (Note: the version number might be different).,,,,,,,,,,, This should restart the Apache server.
Now we need to create a test PHP to see if everything is working.,, Save this file in the directory "C:\Server\Apache2\htdocs" as "phpinfo.php".
Notepad has a bad habit of adding .txt to the end of all documents you save, so make sure from the "Save" dialog that comes up in Notepad, change "Save as type" from "Text Documents (*.txt)" to "All Files".
Now click the "Save" button to save your new PHP document., In the address bar, type "http://localhost/phpinfo.php".
If everything is set up correctly, you should see a page that looks like this:
About the Author
Scott Brooks
Dedicated to helping readers learn new skills in home improvement and beyond.
Rate This Guide
How helpful was this guide? Click to rate: