Installing PHP Environment
We need our environment to possess a few things: a database server (that will store all of our data for us), a web server (that will be responsible for helping us access our app via a web browser) and PHP (as it has its own dependencies and requirements, which we need to install).
Software Required for to work with PHP
- Browser - Internet Explorer
- Server - Apache
- Server side script - PHP
- Database - MYSQL
Tools to work with PHP
- XAMPP - Cross Apache MYSQL PHP Perl
- WAMPP - Window Apache MYSQL PHP Perl
- LAMPP - Linux Apache MYSQL PHP Perl
- MAMPP - Macintosh Apache MYSQL PHP Perl
If you’re on Windows - XAMPP Setup
XAMPP is a free and open source cross-platform web server solution developed by Apache Friends, consisting mainly of the Apache HTTP Server, MariaDB database, and interpreters for scripts written in the PHP and Perl programming languages. In order to make your PHP code execute locally, first install XAMPP.
- Download XAMPP
- Install the program (check the technologies you want during installation)
- Open XAMPP and click on "Start" on Apache and MySQL (when working with databases)

Check XAMPP are Successfully Running or Not?
- Open any browser
- Type http://localhost in browser url address and press enter.
- If we can see welcome page XAMPP i.e., running successfully, so that we can start working with PHP.
How to write a PHP program
Place your web project inside the htdocs directory. In the common case, if you installed XAMPP directly inside the C: drive of your PC, the path to this folder would be: “C:\xampp\htdocs”

To test the services are up and running you can just enter localhost in your address bar and expect the welcoming page