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