How To Install PHP Or XAMP In Windows 10/8.1/8

Today’s topic is How to Install PHP or how to installed XAMP in Windows. Welcome to the Introduction to PHP series. In the last article, I talked about what PHP is and it works. But PHP is not preinstalled on any operating system whether it’s Windows, Linux, or Mac. In this article, I’ll show you how to install PHP in Windows 10/8.1/8.


How To Install PHP Or XAMP In Windows 10

As I mentioned in my last article that PHP is not preinstalled on any operating system. If you’re learning web development then you will need to make a PHP environment to be able to run PHP and see the output in the browser.

PHP And Required Packages

Web server

PHP is an open-source programming language so you can download and install it. But it’s all to be able to see PHP output in the browser. If you just install PHP and write some PHP code, open it in the browser, then the code won’t execute. You’ll see the code as you typed in the code editor. Besides PHP we also need a web server. Now don’t think of a web server as a supercomputer with terabytes of installed memory.

Here a web server is a simple program that sits on your computer and listens to the HTTP requests and based on those requests, the web server processes information and sends the output to the user browser. So we also need a web server.

Database system

Nowadays in almost all modern web applications, you have a database. With the database, we can build amazing functionalities in our web applications. For example, sign up or sign in functionality is very common. You can create this functionality with a database by creating user records and saving user credentials in those records.

Not just the sign-up or sign in, if you use Twitter, Facebook, or any other social networking site today, every function you use is based on the database system, likes, comments, tweets, and retweets, etc.

One of the most popular database programming languages is Mysql. It’s not hard to learn Mysql. It’s very simple to talk to a database in MySQL. For example, if you want to insert a record in a database table, the query for this would be –

INSERT INTO user SET username = 'sohail', email = '[email protected]', password = 'pass34342432';
where user is a table and username, email, and password are table column -

Even if you don’t install a database system, you’ll still be able to see your PHP code working. But, you will not be able to create a lot of modern web app functionalities without a database system.

Install PHP, Apache, and Mysql Or XAMPP

You can either download all these packages individually by downloading from their official websites and compile them to install or you can download all of them or even more just by download a single package such as XAMPP.

XAMPP stands for X – cross platform, A – Apache(web server), M – Mysql(database language), P – PHP or P – Perl.

Download XAMPP For Windows 10/8/8.1/7

xampp official website

You can download XAMPP from the official website.

Click XAMPP for Windows.

select xampp packages
select xampp installation directory
xampp is installing
do you want to start the xampp control panel

And that’s it. The download will start. After you have downloaded XAMPP, double click the .exe file and run the setup. It’s very. Simply keep pressing next and select a couple of options and it’s done.

You’ll be asked to select the packages that you want to install.

You can uncheck Perl because it’s a different language and you won’t need it when you’re learning PHP.

Now select the directory where you want to install XAMPP. It’s very important. XAMPP is the directory that will contain all your future projects. To select a safe place where it’s not likely to delete. XAMPP folder has all your PHP files such as PHP configuration file ‘php.ini’ etc.

After you have selected the installation directory, click next and finish. Now the installation will start.

When the installation is finished, you’ll be prompted to close the installer and start the XAMPP control panel.

XAMPP Control Panel

xampp control panel

So take a deep breath now. You can see that there are five software and each option to start, configure, and check logs. I’ve talked about the first two software already. Apache is a popular web server, MySQL is a database system.
To start Apache server, and MySQL server, simply click start.

After starting the server, to check everything is working perfectly, open a web browser and type in ‘localhost’.

If you see the above web page, it means everything is working and you’re ready to start writing PHP.

Create PHP example page

create php project in htdocs
php example code
php example page

To create a project, go to XAMPP >> htdocs. Now here you can create a folder and contain project files in it.

Create a test.php file and write some PHP code.

Result in a web browser –


And it’s all. You’ve successfully created a PHP environment. You can start your first PHP project and write some PHP. In the next article, I’ll talk about the best code editors for PHP. A good code editor speeds up programming and enhances your programming skills.

Share your love
Mohd Sohail
Mohd Sohail

Leave a Reply

Your email address will not be published. Required fields are marked *