If you are using Fedora, CentOS, Red Hat or Scientific Linux I am going to show you the basic install of Apache2 and PHP using yum.

Install Apache2.

To install Apache2 just enter the following command:

yum install httpd

Install PHP

To install PHP just enter the following command:

yum install php

Start up Apache2

The following command is going to setup Apache and set it up to start everytime your workstation or server books.

chkconfig --level 2345 httpd on; service httpd start

Test Your Install

Now its time to test your install of Apache2 and PHP, To Do this we are going to make a small PHP file and run in from your brower.

The following command will create and index.php file with the PHPInfo command in it:

echo “<?php phpinfo(); ?>” > /var/www/html/index.php

Now launch your browser to or http://localhost if anything was done righ your output should look like the one below:

Install Apache2 and PHP with Johnathan Mark Smith

Now that’s it. have fun with Apache2 and PHP.

If you have any questions or comments please email me at john@johnathanmarksmith.com


19 April 2013