Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to Install and Configure PHP in Fedora Linux  (Read 4127 times)

0 Members and 1 Guest are viewing this topic.

Harisankar

  • Guest
How to Install and Configure PHP in Fedora Linux
« on: February 27, 2015, 07:15:49 am »
BASIC INSTALLATION STEPS

1. Install PHP via yum
-----
root# yum install php
-----

2. Configure php.ini
-----
root# vi /etc/php.ini
-----

Minimal configuration:
-----
    -FIND:
    ;session.save_path = “/var/lib/php/session”
    -CHANGE INTO
    session.save_path = “/var/lib/php/session” (or other directory you want to store the session)

-----

3. Configure httpd.conf
-----
root# vi /etc/httpd/conf/httpd.conf
-----

Minimal configuration:
-----
- FIND:
DirectoryIndex index.html index.html.var
– APPEND index.php TO END OF LINE
DirectoryIndex index.html index.html.var index.php
– FIND:
AddType application/x-gzip .gz .tgz
– AFTER the line ADD:
AddType application/x-httpd-php .php
-----

4. Restart Apache
-----
root# service httpd restart
-----

5. Test if PHP is properly working
-----
root#php -r "phpinfo();"
-----

POST-INSTALLATION STEPS

1. Installing some extensions that are extensively used in web development
-----
root# yum install php-mysql php-pdo php-xml php-mcrypt php-mbstring php-gd
-----

****************

    php-mysql   : php extension for mysql (this will install php-pdo, an extension for native database abstraction in PHP called PDO, as dependency)
    php-xml   : php extension for XML-related functionalities
    php-mcrypt   : php extension for mcrpyt encryption library
    php-mbstring: php extension for multibyte functionalities (used when working with various charsets)
    php-gd   : php extension for dynamic creation of images in PHP using GD library 

****************


2. Configuring the extensions
-----
root # php -r "phpinfo();" | grep "/etc/php.d/" --color=always
-----

3. Restart Apache
-----
root# service httpd restart
-----

Thank you :)