PHP 5.6 not being recognized by Virtualmin in CentOS 7

I have the latest Virtualmin (similar to Plesk) installed on CentOS 7 which has php version 5.4 and apache 2.4 installed by default. I have successfully installed a second php version, php55, from the rhscl repo and it is recognized and working great. BUT now I installed rh-php56 from the same repo and when I recheck the configuration, Virtualmin doesn't seem to recognize it. What am I doing wrong?

Here are the commands I ran followed by the Virtualmin Re-Check Configuration:
yum install rh-php56
yum install rh-php56-php-mysqlnd rh-php56-php-gd rh-php56-php-xmlrpc rh-php56-php-bcmath rh-php56-php-mbstring rh-php56-php-pecl-xdebug rh-php56-php-xdebug-debuginfo rh-php56-php-pspell rh-php56-php-soap rh-php56-php-intl rh-php56-php-pecl-jsonc-debuginfo rh-php56-php-pecl-xdebu-debuginfo rh-php56-php-recode
scl enable rh-php56 bash

Open in new window

Just for reference the additional repos used are:

Open in new window

Here are a few references I used that show how to successfully install : (this one gave me the most specifics)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

matt1237Author Commented:
Virtualmin was looking for a specifically formatted name and /opt/rh/rh-php56 didn't conform to that.

So I created a symlink /opt/rh/php56 pointing to /opt/rh/rh-php56 and suddenly Virtualmin recognized it. When I ran command line things it still used /usr/bin/php so if you also want it to use the new version another symlink /etc/scl/conf/php56 pointing to /etc/scl/conf/rh-php56.

Then add this simple script to the end of your ~/.bashrc file so it updates bash to use the correct one each time you fire up a new bash instance.

# ------------------------------------------------------------------
# Define functions to enable SCLs for current session.
# ------------------------------------------------------------------
scl_enable() {
    if [[ $X_SCLS != *$1* ]]; then
        . /opt/rh/$1/enable
        export X_SCLS="$1 $X_SCLS"

scl_show_enabled() {
    echo "Using Software Collections:"
    echo -e "  ${X_SCLS// /\n  }"

# -----------------------------------------------------------------
# Enable SCLs, display list for user.
# -----------------------------------------------------------------
scl_enable php56

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.