Centos – Switch PHP version on Centos 6.4

apache-2.2centosPHP

I'm using CentOS 6.4 and I got Apache 2.2 and MySQL, but the PHP version is 5.5.1 which is a problem for me, because the application which we develop is working with php 5.3 and lower versions. I use this tutorial to install everything: http://www.if-not-true-then-false.com/2010/lamp-linux-apache-mysql-php-on-fedora-centos-red-hat-rhel/

Bust I can't find any answer in web to configure the server correctly to switch php version with cgi or fastcgi.

Can you help me?

Best Answer

You should remove php with all its packages, disable repository from which you installed it (there is any for 5.5.1? wow) and install php package from CentOS base repository - there is 5.3.3.

  1. stop apache.
  2. yum remove php\*
  3. set enabled=0 in /etc/yum.repos.d/<php5.5.51-repository-file>
  4. yum install php (check if yum will catch correct version)
  5. edit /etc/php.ini as you need and start apache.