Php7 and php5 on fedora at the same time Php7 and php5 on fedora at the same time apache apache

Php7 and php5 on fedora at the same time


I suggest you to install remi repository. I assume you use fedora 23.

sudo dnf install http://rpms.remirepo.net/fedora/remi-release-23.rpm

After installing remi repository, you have to edit /etc/yum.repos.d/remi.repo file and enable it.Finally you can install various versions of php. for example:

sudo dnf install php70-php php56-php

You can use them as php70 and php56 along with option or php file you want to run.


Following directions in Remi RPM repo blog worked for me. I can now run php55 or php70.https://blog.remirepo.net/post/2016/04/16/My-PHP-Workstation

Few things that it took to switch to php55:

 module unload php70 module load php55 yum install php55-php-fpm systemctl start php55-php-fpm systemctl enable php55-php-fpm

now both php --version in command line shows PHP 5.5 and also in your browser you will see that phpinfo() shows PHP 5.5.


You can install as many versions as PHP as you want. Just download the source code and compile whichever version you want into separate directories.

./configure --prefix='/usr/local/php-7.0.4'makemake install

Using fpm, you can set up different sockets or TCP ports for each version of PHP which can be used inside your web server config (nginx fastcgi or something like mod_fastcgi for apache)