To install PHP, we will suggest you to install three vital components on your computer system. Following are the three components:
You can either install them individually or choose a pre-configured package for your operating systems like Linux and Windows. The popular pre-configured packages are XAMPP and WampServer.
WampServer is a Windows web development environment. It used to create web applications with Apache2, PHP and a MySQL database. It will also offer the MySQL administrative tool PhpMyAdmin to easily manage your databases using a web browser.
The official website for downloading and installation instructions for the WampServer: http://www.wampserver.com/en/
Creating PHP Script:
After you have successfully installed WampServer on your computer. Next we will create a very simple PHP script that displays the output “Hello PHP!” in the browser window.
Click ok on the WampServer icon somewhere on your Windows task bar and select the “www directory”. Alternatively, you can access the “www” directory through navigating the C:\wamp\www. Make a subdirectory in “www” directory let’s say “project”.
Now open the code editor and create a new PHP file then type the following code:
Now save this file as filename.php i.e. “demo.php” in your project folder (located at C:\wamp\www\project), and view the result in your browser through visiting this URL: http://localhost/project/demo.php.