Introduction and Installing PHP
Installing and compiling PHP
As PHP is server scripting language so to compile PHP code you need a server. PHP program runs on XAMPP , WAMP etc. But I recommend XAMPP. XAMPP includes PHP, MySQL, Apache web server, Perl and File Zilla.
Download XAMPP from this site https://www.apachefriends.org/download.html.
Install XAMPP on C drive. You can install XAMPP on D and E drive but I recommend C.
Go to start Menu and Open XAMPP. From XAMPP control panel run Apache web server and MySQl. MySQL is an open source RDBMS and Apache is world’s most famous web server.
Now write your first PHP Program and save it in C:\xampp\htdocs as “first.php”.
You must have to save your PHP program in htdocs file in C/xampp/htdocs . Do not save any other location it will not work.
Now open browser and write localhost/first.php or enter http://127.0.0.1/first.php.
Congratulation! You have successfully created your first php program.