Last active
December 16, 2015 15:19
-
-
Save JohnathanMarkSmith/5455065 to your computer and use it in GitHub Desktop.
How to install Apache2 and PHP on Fedora, CentOS, Red Hat and Scientific Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to install Apache2 and PHP on Fedora, CentOS, Red Hat and Scientific Linux | |
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 http://127.0.0.1 or http://localhost | |
Now that’s it. have fun with Apache2 and PHP. | |
If you have any questions or comments please email me at john@johnathanmarksmith.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment