X
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time.
This article has been viewed 79,843 times.
Learn more...
This article explains how to install PHP on Windows 7. This includes how to install the whole PHP, Apache and MySQL on Windows 7. You'll also learn how to configure the environment to ensure that the server is running correctly.
Steps
-
1Download the required software.
- Download PHP at www.php.net/
- Download Apache at http://www.apache.org/
- Download MySQL at http://www.mysql.com/
-
2Unzip these three files.Advertisement
-
3Install three software one by one. First MySQL, then Apache, and PHP last. MySQL is a database software which contains data. Apache is a server and PHP is the language that you will learn and use.
-
4Install MySQL. Remember the username and password you entered because you can’t enter your database system without the username and password. Follow the instructions step-by-step. Install MySQL first because MySQL don't need to configure the environment. You just follow the instructions and you can install it correctly.
-
5Install Apache. Open the file and follow the instructions. Do not change anything because if you do, you have to change a lot of things in the future. That will cause you problems if you are a beginner at all this.
-
6Open your web browser and type ‘localhost’ as the address. If it shows ‘It works!’, that means you have successfully installed the Apache. Then you can go on to the next step.
-
7Unzip the PHP file and copy it to the C disk. Rename the folder as ‘php’. It’s easy to remember when so named.
-
8Find the file named ‘httpd.conf’ at ‘C:\Program Files\Apache Software Foundation\Apache2.2\conf’. Edit it with Notepad++. Add two important sentences at the end of file: ‘LoadModule php5_module C:/php/php5apache2_2.dll’ ‘AddType application/x-httpd-php .php’. Do not forget to save the file. Close the notepad and restart the Apache.
-
9Open the htdocs folder at ‘C:\Program Files\Apache Software Foundation\Apache2.2’. Create a new file called ‘test.php’. Open it with Notepad and enter the following contents: Don't forget to save.
-
10Open your web browser and enter ‘localhost/test.php’ as the address. If the browser shows your PHP version and other things, that means you have successfully installed the whole PHP. Now you can start to use and learn PHP on your own computer.
Advertisement
Warnings
- Remember the password for your MySQL database!⧼thumbs_response⧽
- Do not miss any step during the installation!⧼thumbs_response⧽
Advertisement
About This Article
Advertisement