PHP is a server-side scripting language, which means you need a web server to run PHP programs or the PHP scripts. Luckily, installing is more comfortable than it sounds. With XAMPP, we are able to install an Apache server on our own computer, plus PHP, MySQL and much more.
Download the installer version for your operating system (Windows, Mac OS or Linux) and follow the installation instructions.
The installer of XAMPP will ask where you want to have the package installed. Just leave it default, at C:\xampp\, other paths are also possible. If we now want to look at our PHP scripts, we need to copy/save them to the htdocs folder under C:\xampp\ htdocs.
Before we run PHP scripts, we need to start the web server. If you have Skype installed, you should stop it before starting the web server. It’s because unfortunately, Skype blocked the starting of the Apache web server. After starting the web server, you can restart the Skype again.
You can either start the web server by calling xampp_start.exe or by running xampp-control.exe and activate Apache on the web server. The PHP scripts that we have saved in the htdocs folder can then be accessed via the address http: // localhost / or http://127.0.0.1/.
If an error message appears, then try to specify the full URL of php script to the page, for instance http: // localhost/sitename.php. If you have subfolders in the htdocs folder, then the name must also be entered in the URL.
That was the whole secret of the installation.
Later, to get your website online, your web host needs to support PHP accordingly. Meanwhile, PHP is included in almost every web hosting package, so finding a hoster should not be too difficult.