Introduction and Installing PHP on Local Host

Introduction and Installing PHP on Local Host

April 30, 2016 0 By Abid

PHP Introduction and Installation

PHP is the most popular server scripting language. It was created by Rasmus Lardof in 1994. Initially it was designed for web development but now it is also used for general purpose programming language. PHP initially stands for Personal Home Page now it is acronym for PHP: Hyper Text Preprocessor. PHP is widely used for web development . The most popular social media website Facebook and most popular content management systems WordPress, Joomla and Drupal are written in PHP.  Nearly 75% of websites currently using PHP as server scripting language. A web developer should learn HTML, CSS, Javascript and PHP. Without PHP you cannot develop dynamic websites. Although there are many server scripting languages like  and Node.js. But PHP is most popular and open source scripting language. Its syntax is similar to C language.  If you have learned C language then you you will learn PHP easily.

Also Read Install WordPress on localhost using XAMPP Step By Step Tutorial

PHP Installation and Compiling

As PHP is server scripting language so to compile PHP code you need a server. PHP program  runs on XAMPP and WAMP servers. But I recommend XAMPP.  Because XAMPP includes not only PHP but it also includes MySQL, Apache web server, Perl and File Zilla.

Download XAMPP from this site

Follow given steps to install PHP on local server:

Step 1

Install XAMPP on C drive. You can Install XAMPP on D and E drive too but I recommend C drive.

Step 2

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.

Running PHP program using XAMPP

Step 3

Now open any text editor like notepad and sublime text. Write your first PHP Program and save it in this directory: C:\xampp\htdocs . Name it “first.php”.

PHP Program Code

You have to save your PHP program in htdocs file in C/xampp/htdocs . Do not save any other location it will not work.

Step 4

Now open browser and write localhost/first.php or enter

Running PHP local host

It will show the output of PHP program that you have written. Now you have successfully created your first php program.

Watch this video for live example of writing your first PHP program.