PHP Installation

PHP Installation

Installation of PHP is quite easy. Let’s see how we can install it on Windows 10 OS. PHP installation includes installation of XAMPP, which is an open source web server package.

What you need for installation

For installing PHP, we need the following,

  • XAMPP: Cross-platform web server package
  • Web Server: Apache

For all of the above, we will be using a free and open source cross-platform web server package known as XAMPP, that includes the following,

  • Apache Server
  • MySQL Database
  • PHP

Now, we will learn how to run our first PHP program,

PHP Installation – XAMPP

Step 1: Go to XAMPP website and download XAMPP for Windows OS.

Step 2: Let’ say you install it in C: drive. Now, go to htdocs folder,

Step 3: Open htdocs and create a new folder myphp for your project. All our project files will get
stored here.

Step 4: Open the folder myphp and add a file with extension .php. We’re adding a file, index.php

Now the directory looks like the following,

Step 5: Open new.php and add the following code,

Before moving further let’s understand the above code.

  • Our PHP code gets embedded into HTML,
  • <?php & ?> are opening and closing PHP tags respectively,
  • echo is an output statement, which is used to output values to the screen.

Step 6: Now, go to start and type XAMPP Control Panel.

Step 7: Click on it and you can see the following XAMPP Control Panel dialog box,

Step 8: Click on Start for Apache. This will start the Apache server,

Step 9: Now, go to the web browser and type, localhost. After pressing enter, you can see the following. The installation is successful if you see what is shown in the following screenshot,

Step 10: Now type your project folder name myphp and press enter. On pressing enter, your project directory will be visible,


Step 12: As shown above, click new.php. Our first PHP program web page is visible. We created a sample program above and the following is the output,

PHP Introduction
PHP First Program
Studyopedia Editorial Staff
Studyopedia Editorial Staff

We work to create free tutorials for all.

No Comments

Post A Comment