To run the PHP program we need the following things:
- PHP file
- Web server (eg, Apache)
- Web browser (eg, Mozilla, Chrome)
We can install PHP and Apache as separately or install the “XAMPP” software which contains PHP, Apache and Mysql package. Here we have explained how to install PHP in your windows system using XAMPP.
- Go to http://www.apachefriends.org/download.html and download the latest version of XAMPP.
- Run the downloaded .exe file. The following window will appear. Click “Next”.
- There will be selected all available components as default. If you don’t want any of components then you can uncheck the box.
- You can change the installation path if you want any other location of default path (C:\xampp).
- Click “Next” to start installation process
- You have finished your XAMPP installation.
- Go to C:\xampp and run “xampp-control.exe”. The XAMPP control panel will be displayed. Click “Start” button for Apache module.
- Now you are ready to run the PHP file. Craete your first PHP file and save it into C:\xampp\htdocs\sample.php. Then run http://localhost/sample.php in your browser and enjoy.