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

  1. 1
    Download the required software.
  2. 2
    Unzip these three files.
    Advertisement
  3. 3
    Install 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.
  4. 4
    Install 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.
  5. 5
    Install 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.
  6. 6
    Open 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.
  7. 7
    Unzip the PHP file and copy it to the C disk. Rename the folder as ‘php’. It’s easy to remember when so named.
  8. 8
    Find 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.
  9. 9
    Open 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.
  10. 10
    Open 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.
  11. Advertisement

Warnings

Advertisement

About This Article

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.
How helpful is this?
Co-authors: 5
Updated: April 25, 2022
Views: 79,843
Categories: PHP
Advertisement