Webserver using PHP 5.4 despite being set to 5.6

DennisMidjord

Well-Known Member
Sep 27, 2016
353
78
78
Denmark
cPanel Access Level
Root Administrator
Hi,

One of our customers contacted us about some PHP extensions that wasn't enabled despite being enabled under 'Select PHP version'. I quickly saw that his website (which is an addon domain with document root in /domainfolder) was using PHP 5.4, despite being set to 5.6. This was not the issue with his primary domain from the public_html folder.

What could be causing this issue?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Is this system using EasyApache 4? Are any third-party applications such as CloudLinux with PHP Selector installed? Have you verified the domain name in-question resolves to the cPanel server?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

EasyApache 3 does not support MultiPHP functionality, suggesting the use of PHP Selector on the system:

CloudLinux Documentation

Please review the above document from CloudLinux to ensure you are using it correctly on the system.

Thank you.
 

DennisMidjord

Well-Known Member
Sep 27, 2016
353
78
78
Denmark
cPanel Access Level
Root Administrator
I'm a bit confused. I might've misunderstood what MultiPHP is then.
It works fine in the public_html folder (also switching PHP version), so I don't understand why it won't use the same version on an addon domain.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
MultiPHP is only offered with EasyApache version 4. You're using PHP Selector with CloudLinux, which is a third-party application developed by CloudLinux and not cPanel.

What's the .htaccess file within the subdirectory associated with the addon domain name look like? There's an article here you may find helpful:

Different PHP versions per directories using SuPHP – CloudLinux KnowledgeBase

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
There's no .htaccess, it seems. Well, I upgraded to EasyApache 4 and everything worked right after.
I'm happy to see it's now working well. Feel free to let us know if we can be of any further assistance.

Thanks!
 

DennisMidjord

Well-Known Member
Sep 27, 2016
353
78
78
Denmark
cPanel Access Level
Root Administrator
Hi Michael,

Thanks for replying so quick!
I got one more question. I see that php_value are not allowed in .htaccess with EasyApache4 - does this mean every account has to have a php.ini file where php values are set?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I got one more question. I see that php_value are not allowed in .htaccess with EasyApache4 - does this mean every account has to have a php.ini file where php values are set?
It's still allowed if you are using DSO as your PHP handler. The following document is helpful as well:

The cPanel PHPRC PHP Patch for EasyApache 4 - EasyApache 4 - cPanel Documentation

Additionally, feel free to review this post:

In Progress - EA4 php.ini/local.ini behavior

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Oh, I just couldn't find DSO under PHP Extensions. According to this guide, it should be there, right?
Per that document:

EasyApache 4 does not include the DSO handler by default. To use the DSO handler, install the PHP package that you wish to use.
You can install the DSO PHP package in the PHP Extensions section of WHM's EasyApache 4 interface (WHM Home >> Software >> EasyApache 4). Keep in mind you can only use DSO as the handler for one version of PHP on your system.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

The DSO package for PHP with EasyApache 4 is named with the "-php" suffix. For example, the DSO package for PHP 7.0 is:

ea-php70-php

You'd search for php70-php when installing it via the EA4 interface in WHM, or install it via the command line with a command such as:

Code:
yum install ea-php70-php
Note that you can only run one DSO package at a time.

Thanks!
 

DennisMidjord

Well-Known Member
Sep 27, 2016
353
78
78
Denmark
cPanel Access Level
Root Administrator
Hi,

Thanks! I installed the DSO package for 5.6 as this is the most used by our clients.
I must say that I really like the 'new' way of doing it in EA4. Would it be safe to remove PHP Version Selector using yum groupremove alt-php? Would that mess something up?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Would it be safe to remove PHP Version Selector using yum groupremove alt-php? Would that mess something up?
It's possible it will change the way PHP is configured for your existing accounts and addon domain names. Ensure you review the documentation for PHP Selector and EasyApache 4 provided by CloudLinux before removing it:

PHP Selector > Control Panel Integration > cPanel

Thank you.
 

DennisMidjord

Well-Known Member
Sep 27, 2016
353
78
78
Denmark
cPanel Access Level
Root Administrator
Hi,

It seems like the upgrade to EasyApache4 caused more problems than I had thought. If we downgrate to EasyApache3 using /scripts/migrate_ea3_to_ea4 --revert --run, does everything then work as before?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Yes, it reverts the last EasyApache 3 profile that was built. That said, are there any specific issues with EasyApache 4 that you'd like us to help troubleshoot?

Thank you.
 

DennisMidjord

Well-Known Member
Sep 27, 2016
353
78
78
Denmark
cPanel Access Level
Root Administrator
Hi Michael,

It wasn't really issues with EasyApache4 (although navigating was different) - it was our clients. Some were using PHP 5.4, some PHP 5.6, and some PHP 7. This caused a lot of issues as all of them used the one we set as default. Some clients' websites broke down.

I need to read more about EasyApache4 before I make the change. Your help is much appreciated, though!
 
  • Like
Reactions: cPanelMichael