Ask Your Question

How to compile php in fedora 18?

asked 2013-03-29 09:52:49 -0500

Mohsin Khan Shuvo gravatar image

updated 2013-03-31 19:40:32 -0500

FranciscoD_ gravatar image

I have to install a complete webserver on my fedora 18-gonme 32-bits.. But as i am new with php in linux, i can't compile php like in windows.

So a little guidance would help.

I already installed php, apache and mysql server. But please someone tell how to open a php file in browser in fedora 18.

edit retag flag offensive close merge delete


The document root of the default web site is /var/www/html just open the browser create your index.php in that directory and or whatever you call it.

hhlp gravatar imagehhlp ( 2013-03-30 07:50:19 -0500 )edit

I already did it but i don't know how to compile php or open php in a browser

help me with opening php files, not installing php server...

Mohsin Khan Shuvo gravatar imageMohsin Khan Shuvo ( 2013-03-30 07:50:33 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2013-03-29 13:59:52 -0500

hhlp gravatar image

Installing Apache2

Apache2 is available as a Fedora package, therefore we can install it like this:

sudo yum install httpd

Now configure your system to start Apache at boot time...

sudo systemctl enable httpd.service
sudo systemctl start httpd.service

Now direct to your browser to, and you should see the Apache2 placeholder page.

Installing PHP5

We can install PHP5 and the Apache PHP5 module as follows:

sudo yum install php

We must restart Apache afterwards:

systemctl restart httpd.service

Installing MySQL:

sudo yum install mysql mysql-server

Start MySQL server and autostart MySQL on boot

sudo systemctl start mysqld.service 
sudo systemctl enable mysqld.service

MySQL Secure Installation

Set (Change) root password
Remove anonymous users
Disallow root login remotely
Remove test database and access to it
Reload privilege tables

Start MySQL Secure Installation with following command

sudo /usr/bin/mysql_secure_installation

Another usefull package like mysql and php support, Select what you need:

APC (php-pecl-apc) – APC caches and optimizes PHP intermediate code
CLI (php-cli) – Command-line interface for PHP
PEAR (php-pear) – PHP Extension and Application Repository framework
PDO (php-pdo) – A database access abstraction module for PHP applications
MySQL (php-mysql) – A module for PHP applications that use MySQL databases
PostgreSQL (php-pgsql) – A PostgreSQL database module for PHP
MongoDB (php-pecl-mongo) – PHP MongoDB database driver
SQLite (php-sqlite) – Extension for the SQLite V2 Embeddable SQL Database Engine
Memcache (php-pecl-memcache) – Extension to work with the Memcached caching daemon
Memcached (php-pecl-memcached) – Extension to work with the Memcached caching daemon
GD (php-gd) – A module for PHP applications for using the gd graphics library
XML (php-xml) – A module for PHP applications which use XML
MBString (php-mbstring) – A module for PHP applications which need multi-byte string handling
MCrypt (php-mcrypt) – Standard PHP module provides mcrypt library support

open a terminal and type :

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

there are another Pick the ones you need of them, you need and install them like this:

yum install php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-magickwand php-mssql php-shout php-snmp php-soap php-tidy

The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

sudo vi /var/www/html/info.php


Now we call that file in a browser (e.g.

edit flag offensive delete link more

Question Tools


Asked: 2013-03-29 09:52:49 -0500

Seen: 3,704 times

Last updated: Mar 31 '13