Introduction to PHP - Installation

  »   PHP Introduction  »   Introduction to PHP - Installation

To start using PHP you need a web server running PHP and MySQL. Although MySQL is not a must for using PHP, mixing these two you can achieve great things.

You can easily find a hosting provider that supports PHP and MySQL. Since PHP coming for free, your hosting provider will surely support it. The simplest way to stat make use of it is by uploading some PHP files and access them via URL.

On the other hand you can install PHP locally on your computer.To install it locally on your PC you will first need to:

  • install Apache webserver for example
  • install PHP package
  • add MySQL database support

You can find a complete PHP and dependencies installation guide here:

All in one PHP sulution

If you just want to jump and write some PHP code, build some test pages and see what happens, you can use the XAMPP package. According to XAMPP developers, it is "easy to install Apache distribution containing MariaDB*, PHP, and Perl". And it "has been set up to be incredibly easy to install and to use".

I am a big fan of it and I encourage you to use ti before working with more complex environments. You can download XAMPP here:

*MariaDB is basically a new and free version of MySQL. It is a fork of the good old MySQL, and it's becoming a replacement for MySQL after ORACLE buying it.

In this tutorial, for the sake of simplicity, we will assume that you are using a locally installed XAMPP and you are ready to write some PHP code.

To test your installation just create a new directory inside "C:\xampp\htdocs\" and place a new index.php file inside. This code should be enough to test that everything is in place

PHP<?php echo "<h1>it works!!</h1>"; ?>

You should get a simmillar result.

Test php on xampp. It works message.

Great! you are now ready for the next step.