Joomla 3.3, CentOS 6 and PHP version - putting all together

Written by Gionatan Danti on . Posted in Linux & Unix

User Rating:  / 9

SLC, Apache and PHP configuration

Step n.1: enable the SCL repo and install PHP 5.4

yum install -y centos-release-SCL.x86_64
yum install -y php54.x86_64 php54-php-mysqlnd

If all went ok, you have now a side-loaded PHP 5.4 version inside your /opt/rh/php54 directory. Inside that dir, the shell file "enable" can be used to use the new PHP version (by mangling the ENV vars)


Step n.2: create a PHP wrapper script in /var/www/cgi-bin/php54-wrapper

source /opt/rh/php54/enable
exec php-cgi $1

Then give it the appropriate permissions and restore the selinux context:

restorecon -RF /var/www/cgi-bin/php54-wrapper
chown apache:apache /var/www/cgi-bin/php54-wrapper
chmod ugo-rwx /var/www/cgi-bin/php54-wrapper
chmod ug+rx /var/www/cgi-bin/php54-wrapper


Step n.3: configure the appropiate VirtualHost to use the new PHP version via the CGI interface

AddHandler php-cgi .php
Action php-cgi /cgi-bin/php54-wrapper
<Location />
    Options +ExecCGI

This configuration instruct Apache to use the new PHP 5.4 version for this and only this Virtualhost, leaving all others configuration intact: other Virtualhosts will continue to use PHP 5.3 version via mod_php.


#1 JesusLopezSEO 2015-10-19 14:55
Great tutorial!!. i was looking for info to upgrade my virtual server and i will try to do for myself.

Thanks a lot from Spain!!

You have no rights to post comments