I have installed Fedora 25 on a server and need to downgrade php from 7 to 5.6. I have done the following:
dnf remove php
dnf remove php-common
wget https://rpms.remirepo.net/fedora/remi-release-25.rpm
rpm -Uvh remi-release-25.rpm
dnf --enablerepo=remi install php56 php56-php-common php56-php-cli php56-php-mbstring php56-php-mcrypt php56-php-pear php56-php-xml php56-runtime php56-php-mysqlnd
Everything worked fine but now everything is named php56 instead of php and so the system can't find anything. For example:
# php -r "echo 'Current PHP version: ' . phpversion();"
-bash: /usr/bin/php: No such file or directory
# php56 -r "echo 'Current PHP version: ' . phpversion();"
Current PHP version: 5.6.30
How do I take the last step and make everything (including packages) work like before?
I tried creating a symlink as follows, but php code does not run from the web, so the apache->php link is broken.
cd /usr/bin
ln -s /opt/remi/php56/root/usr/bin/php php
Thanks in advance.
This is how Software Collections are designed: parallel installation without altering base system and allow multiple versions. So /usr/bin/php is not provided on purpose.
You can read My PHP Workstation.
For mod_php (apache module), if you can remove "php" (base package) and install "php56-php" (which is missing in your list), it will work out of the box. If you can't remove "php", you can disable its LoadModule directive (/etc/httpd/conf.modules.d/15-php.conf), so the php5 module will be loaded (/etc/httpd/conf.modules.d/10-php56-php.conf).
For FPM (FastCgi server), when php56-php-fpm service runs you only have to adapt the path to the socket in webserver configuration (apache, nginx or lighttpd)
For CLI, you can use the module command (and most applications will find php and related commands in the PATH)
And if you really want a single version, you can create the symlink, it will work: