Web Info and IT Lessons Blog...

Monday 20 October 2014

How to install apache service to run php?

Apache

This is the first lesson in PHP lessons series and in this lesson we will focus on building up the environment for our php scripts to run locally in our web browsers. As php is a server side scripting language therefore we cannot run a php script directly in our web browsers like we do in html. To run a php script in our web browsers we will need to install a free open source web server package like XAMPP, LAMP, WAMP etc.

LAMP is used if you are using linux environment, XAMPP and WAMP are used in windows environment. We will install XAMPP server in this lesson to run our php scripts. To install XAMPP server download the set up of latest version of XAMPP available from (https://www.apachefriends.org/index.html) and install it by running the .exe file. Once the XAMPP server is installed, we will need to start the Apache service to run php scripts. Apache service in XAMPP can be started by running the XAMPP control panel. You can find XAMPP control panel by running a file looking like this one:

XAMPP File

You will find a panel like this one by running the file mentioned above:

XAMPP Control Panel

Click on the start button in front of Apache to start running the apache service successfully. Once you click the start button, the Apache service will start running on port 80.

XAMPP Control Panel

To check every thing is running fine and we are ready to run php files in our browser just type http://localhost/ in your web browser and execute it. You should get a screen like the one shown below in front of you:

PHP running

If you do not get this screen, it means that something is wrong with your installation or the version is not compatible with your system or some other progam is already using port 80 (possibly skype) in your system.



No comments:

Post a Comment