November 19

Linux: Upgrading PHP 5.4 to PHP 5.6 via RHSCL but the php version still shows as 5.4

You need to use scl enable to add PHP 5.6 to your environment. 

To start using the software collection rh-php56 you need to enable it using the below command.

# scl enable rh-php56 bash

After this please check the output of below command:

# php -v

Also make sure to add this permanently to your environment variable as this setting will only remain until reboot.

To make one or more RHSCL packages a permanent part of your development environment, you can add it to the login script for your specific user ID. this is the recommend approach for development as only processes run under your user ID will be affected.

Add the following line to your ~/.bashrc:

vi ~/.bashrc

# Add PHP 56 from RHSCL to my login environment:
source scl_source enable rh-php56

After making the change, you should log out and log back in again.

Note: When you deliver an application that uses RHSCL packages, a best practice is to have your startup script handle the scl enable step for your application. You should not ask your users to change their environment as this is likely to create conflicts with other applications.


Copyright 2021. All rights reserved.

Posted November 19, 2021 by Timothy Conrad in category "Linux

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B