How to install PHP on windows

Spread the love

To install PHP on windows and to run any PHP application you require 3 basic components:

1. Web server software: This is just a virtual web server which runs on your PC. For Windows system default is Internet Information System (IIS). And other is Apache server, which is free and widely used to install PHP on windows.

2. Database software: PHP is most popularly work with MySql. Though it can work with other databases also, because of flexibility and more feature of MySQL PHP is mostly used with MYSQL.

3. PHP parser: PHP parser is used to generate HTML output after processing of PHP script. Which can run on any browser?

Setup PHP Environment:

All the above three components are available in single product i.e. a Wamp server. Just go to Wamp server site and download the latest version for your desktop and install it. To install PHP on windows Wamp provides a complete solution in one single package.

You will see wamp server icon in desktop and in the taskbar. Just run it and wait until the color of wamp server icon turns green in the taskbar.

How to install PHP on windows

After installation, go to your browser and type “http://localhost/info.php“. You will see a page showing complete configuration information of PHP installation on your PC.

Also as shown in above figure click on “Localhost” link. This will show you the server configuration page. You can also reach the server configuration page using IP address 127.0.0.1 in your browser.

After installation, let’s say wamp is installed in default path in “C” directory of your windows operating system. Then Wamp will create few folders in path “c:wamp“. You will see one folder named “www”. All of your PHP scripts and applications should reside in this folder, i.e. in path “c:wampwww“.

How to install PHP on windows

Example:

Let’s say you have created script hello.php, it should be saved inside “c:wampwww“.

Now to run this file in your browser, just type in browser address bar – “http://localhost/hello.php” this will show the output of hello.php in the browser screen.

Similarly, you can create new application folders in “www” directory, save your PHP files in that folder and run using path mentioned above.

From onwards we will save all PHP script and run as per above steps. Hope from this tutorial you have learned how to install PHP on windows using Wamp server.


Spread the love

Leave a Comment