Introduction and Installing PHP on Local Host

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 ASP.net  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 https://www.apachefriends.org/download.html.

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 http://127.0.0.1/first.php.


Running PHP local host

It will show the output of PHP program that you have written.

Congratulation! You have successfully created your first php program.

Leave a Reply

error: Content is protected !!