In order to run PHP file in our computer we need to first set environment. So please follow the below steps to set PHP environment.
For downloading XAMPP server click on the download link given below.
For downloading WAMP server click on the download link given below.
In this tutorial we are using XAMPP server, notepad++ and MySQL database.Now I am showing you how to install and start XAMPP server
Download the XAMPP server click on above link.
Install the exe file which is downloaded.
Now to go C drive (or where you install the server) and open XAMPP folder and find XAMPP control file and double click on that.
Click on start button on Apache and MYSQL both.
Now open web browser like Google chrome and type "localhost" and check XAMPP server welcome page is appeared or not. If appeared then our server is started.
Now create your own folder under htdocs , Example name it as test or what ever.
Now write your first PHP code and name it as “index.php” and save it under test folder.
echo "Hello World!";
Now open your web browser and type localhost/test/index.php.