Install apache and php on Fedora 17

By | July 3, 2013

To install the LAMP stack on fedora follow the steps

Install Apache

Install apache server using yum as follows

$ sudo yum install httpd

Launch the apache server

$ sudo service httpd start 
$ sudo systemctl start httpd.service

Enable apache to start on every boot

$ sudo systemctl enable httpd.service

If you need to disable apache from starting on boot then issue a similar command

$ sudo systemctl disable httpd.service

Once done test the apache installation by open http://localhost/ in your browser. It should show the Apache Test Page.
The test page will mention the location of the web files.

You may now add content to the directory /var/www/html/.

Once apache is installed, next thing to install is php.

Install PHP

Install php

$ sudo yum install php php-common

Now install the php modules

$ sudo yum install  php-pecl-apc php-cli php-pear php-pdo php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

Once done create a file called test.php in /var/www/html/ and fill it with these contents

Last Updated On : 3rd July 2013