1 (edited by michal-sk 2015-12-28 13:36:11)

Topic: Unable to switch to php56 from php70

I tried installing php56 and php70, but when i switch to php70 i can not switch back to php56.

When i first install php56, enable it, it works as expected. Than when i install php70, enable it, it works as expected and shows php70, but when i than try to enable php56, it still shows php70.

sudo yum --enablerepo=remi-safe install \
php70 \
php70-php-pdo \
php70-php-mysqlnd \
php70-php-mbstring \
php70-php-mcrypt \
php70-php-mhash \
php70-php-xml \
php70-php-curl \
php70-php-gd \
php70-php-soap \
php70-php-intl \
php70-php-openssl \
php70-php-fpm \
php70-php-xdebug \

sudo yum --enablerepo=remi-safe install \
php56 \
php56-php-pdo \
php56-php-mysqlnd \
php56-php-mbstring \
php56-php-mcrypt \
php56-php-mhash \
php56-php-xml \
php56-php-curl \
php56-php-gd \
php56-php-soap \
php56-php-intl \
php56-php-openssl \
php56-php-fpm \
php56-php-xdebug \

[root@antykor-ms shop]# php -v
PHP 7.0.1 (cli) (built: Dec 16 2015 14:34:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans
[root@antykor-ms shop]# php -v
PHP 7.0.1 (cli) (built: Dec 16 2015 14:34:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans
[root@antykor-ms shop]# scl enable php56 bash
[root@antykor-ms shop]# php -v
PHP 7.0.1 (cli) (built: Dec 16 2015 14:34:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans
[root@antykor-ms shop]#


After uninstalling php70, i can switch to php56:


[root@antykor-ms shop]# scl enable php56 bash
[root@antykor-ms shop]# php -v
PHP 5.6.16 (cli) (built: Nov 26 2015 07:03:47)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans

Re: Unable to switch to php56 from php70

Strange

$ scl enable php70 bash

$ php -v
PHP 7.0.2RC1 (cli) (built: Dec 27 2015 07:58:50) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

$ scl enable php56 bash

$ php -v
PHP 5.6.17RC1 (cli) (built: Dec 10 2015 11:02:44) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

You can also "exit" from the current bash before creating a new one.
You can also use the "php56" and "php70" commands without having to enable the collection.

P.S. what is the content of $PATH ?

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

3 (edited by michal-sk 2015-12-28 13:54:13)

Re: Unable to switch to php56 from php70

[michal@antykor-ms shop]$ scl enable php70 bash
[michal@antykor-ms shop]$ php -v
PHP 5.6.16 (cli) (built: Nov 26 2015 07:03:47) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans
[michal@antykor-ms shop]$ scl enable php56 bash
[michal@antykor-ms shop]$ php -v
PHP 5.6.16 (cli) (built: Nov 26 2015 07:03:47) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans
[michal@antykor-ms shop]$ scl enable php70 bash
[michal@antykor-ms shop]$ php -v
PHP 5.6.16 (cli) (built: Nov 26 2015 07:03:47) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans
[michal@antykor-ms shop]$ 

after some installing and reinstalling, i now cant go to php70.

/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php56/root/usr/bin:/opt/remi/php56/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php70/root/usr/bin:/opt/remi/php70/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/.local/bin:/home/michal/bin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/.local/bin:/home/michal/bin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/

Re: Unable to switch to php56 from php70

maybe something with permissions?

Re: Unable to switch to php56 from php70

[michal@antykor-ms shop]$ php -v
bash: php: command not found
[michal@antykor-ms shop]$ scl enable php56 bash
[michal@antykor-ms shop]$ php -v
PHP 5.6.16 (cli) (built: Nov 26 2015 07:03:47) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans
[michal@antykor-ms shop]$ scl enable php70 bash
[michal@antykor-ms shop]$ php -v
PHP 7.0.1 (cli) (built: Dec 16 2015 14:34:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans
[michal@antykor-ms shop]$ scl enable php56 bash
[michal@antykor-ms shop]$ php -v
PHP 7.0.1 (cli) (built: Dec 16 2015 14:34:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans
[michal@antykor-ms shop]$ 

Re: Unable to switch to php56 from php70

Try:

$ echo $PATH

$ scl enable php56 bash
$ echo $PATH
$ php -v
$ exit

$ echo $PATH
$ scl enable php70 bash
$ echo $PATH
$ php -v
$ exit

$ echo $PATH
Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Unable to switch to php56 from php70

[michal@antykor-ms ~]$ echo $PATH
/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php70/root/usr/bin:/opt/remi/php70/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php56/root/usr/bin:/opt/remi/php56/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/.local/bin:/home/michal/bin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/
[michal@antykor-ms ~]$ scl enable php56 bash
[michal@antykor-ms ~]$ echo $PATH
/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php70/root/usr/bin:/opt/remi/php70/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php56/root/usr/bin:/opt/remi/php56/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/.local/bin:/home/michal/bin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/
[michal@antykor-ms ~]$ php -v
PHP 7.0.1 (cli) (built: Dec 16 2015 14:34:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans
[michal@antykor-ms ~]$ exit
exit
[michal@antykor-ms ~]$ echo $PATH
/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php70/root/usr/bin:/opt/remi/php70/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php56/root/usr/bin:/opt/remi/php56/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/.local/bin:/home/michal/bin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/
[michal@antykor-ms ~]$ scl enable php70 bash
[michal@antykor-ms ~]$ echo $PATH
/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php70/root/usr/bin:/opt/remi/php70/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php56/root/usr/bin:/opt/remi/php56/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/.local/bin:/home/michal/bin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/
[michal@antykor-ms ~]$ php -v
PHP 7.0.1 (cli) (built: Dec 16 2015 14:34:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans
[michal@antykor-ms ~]$ exit
exit
[michal@antykor-ms ~]$ echo $PATH
/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php70/root/usr/bin:/opt/remi/php70/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/opt/remi/php56/root/usr/bin:/opt/remi/php56/root/usr/sbin:/home/michal/software/google-cloud-sdk/bin:/home/michal/software/google-cloud-sdk/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/.local/bin:/home/michal/bin:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/:/home/michal/workspaces/go//bin:/home/michal/Downloads/go/bin/:/home/michal/Software/PhpStorm-141.2017/bin/

Re: Unable to switch to php56 from php70

close/open a new session first.
It seems you are hit by some shell limit (PATH length)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Unable to switch to php56 from php70

close/open a new session first.
It seems you are hit by some shell limit (PATH length)

It also seems something is altering your PATH outside of the SCL command, probably something in .bashrc which is bad...

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Unable to switch to php56 from php70

Notice: /opt/remi/phpxx should be the first one in $PATH.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi