0

I am trying to setup a CentOS server with multiple php versions.
I've managed to do this so far by installing the REMI software collections of php56 and php70 and I got Apache running with different versions etc.

So far so good. Typing php on the command line does not give any information but php56 -v does, for example. So far this is expected behaviour.

I have a few questions now:
1 - I am now curious what will happen to softwares that have scripts that use php on the command line. Like composer scripts? Obviously if the scripts try to run command-line php they will fail.

1a. Is it correct to assume that I have to create a symbolic link between php and the actual php70 for example?

1b. Are there other executables that need to be linked as well? I saw somewhere that phar was linked and some other things. How do I know all the files that need to be linked?

2 - If I try to install phpmyadmin via YUM, it expects to download php 5.4 package. This itself poses a lot of questions in my mind. What do I do in this case because I definitely don't want 5.4 anywhere near my system. And I think obviously if I do step 1a above, YUM will still request to download php dependency. Is there a way I can prevent that or possibly "explain" to YUM that php is already installed as php70 let's say? Or to just ignore the dependency?

Sorry if these are silly questions I have only limited experience in Linux and definitely not enough understanding of YUM. Also this is the first time I face a multiple version issue. Thanks!


UPDATE:

I understand that I have installed the version-specific packages and that's mostly intended because I wanted multiple versions for Apache. I guess the question is how to handle other software that wants to run php on the command line, how to handle YUM php dependencies and what is the usual approach for this scenario?

1 Answer 1

0

Notice: both PHP 5.6 and 7.0 have reached their End of Life and are only supported by the community with best effort ; I heartily recommend to use supported versions (7.1+).

1 - I am now curious what will happen to softwares that have scripts that use php on the command line.

As most script use "/usr/bin/env php", you simply have to enable the proper version before running the script

module load php71
php -v
composer install

1a. Is it correct to assume that I have to create a symbolic link between php and the actual php70 for example?

Yes, it will work, you can also install the php56-syspaths OR php70-syspaths package which will do the work for you

2 - If I try to install phpmyadmin via YUM..

Packaged applications rely on default PHP, and are not aware of SCL installed.

For multiple versions, it will much more simple to install :

  • defaut version (php-* packages) from remi-php## repository
  • alternative version (php##-php* packages) from remi-safe repository

See the Wizard instructions.

Notice: applications in EPEL repository (e.g. phpMyAdmin, GLPI, Wordpress, roundcubemail...) will not work with recent PHP version (7+), so you also have to take latest version from "remi" repository, when available.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .