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.