DeShark

Member
May 4, 2012
24
0
51
cPanel Access Level
DataCenter Provider
We are seeing this happen to one website. It randomly changes from the set version of 7.4 to 5.6. When you look in WHM or cPanel, it shows 7.4. The thing I find interesting is if you go into MultiPHP INI Editor, it asks you to select a location.. the Home directory or the web root. If you select the web root, it shows the current version as 7.4. If you select the Home directory, it shows 5.6. Neither folder has a PHP.ini file. Not sure what that is all about but may be a lead as to what is causing this?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,255
2,220
363
cPanel Access Level
Root Administrator
@DeShark - do you have a .htaccess file in either of those directories? If so, I would expect that to have the standard PHP configuration line near the bottom:

Code:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
 

DeShark

Member
May 4, 2012
24
0
51
cPanel Access Level
DataCenter Provider
Yes,.. in the web root directory, When it switches to 5.6 the .htaccess file disappears. Here is the current one..

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,255
2,220
363
cPanel Access Level
Root Administrator
Thanks for that - it sounds like this would be best handled through a ticket so we can check the domain and server settings, as there really should not be much else controlling the version for an account.

If you are able to open a ticket, please post the number here so I can follow along and keep this thread updated.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,255
2,220
363
cPanel Access Level
Root Administrator
You've mentioned that WHM shows 7.4 no matter when you check - when the version is changed to 5.6, does the .htaccess also still show 7.4? *Something* must be indicating the change, or do you only see this in a PHP info page?

I guess I need to know where you're seeing the change take place so I can know where to start looking.
 

DeShark

Member
May 4, 2012
24
0
51
cPanel Access Level
DataCenter Provider
I think the user is deleting the .htaccess file. When you do that, it reverts to 5.6? Why does it do that? The .htaccess file doesn't control the php version does it?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,255
2,220
363
cPanel Access Level
Root Administrator
The .htaccess access file is necessary if the account is set to anything other than "inherit" in WHM. That is how the PHP version is determined when a custom version is applied to a domain or subdomain.

You'll just want to instruct that user to not remove that file if that is indeed what is happening.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,255
2,220
363
cPanel Access Level
Root Administrator
I guess that's a reasonable assumption from the customer though - "I need to replace all my files, let's wipe it and start over"

In this case, they just need to be aware that file is used for other things besides site content and redirects and then they should not experience this issue.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,255
2,220
363
cPanel Access Level
Root Administrator
That's up to you and your clients. For security reasons I would stick with releases we haven't deprecated, but then the clients may not be happy if you force them to update ancient code. You can likely work with them to set up a time to try a new version and they can test the site then to see if there are problems.