PHP version keeps changing automatically
We have been having this issue for ages, and have even moved servers because we thought our last provider was doing something wrong. But the issue has followed us. We have observed this issue on at least 2 different sites, but it mostly happens to one specific site (our most important one of course). It happens at all times of day and with 2-3 weeks in between, sometimes only days. Last night it happened at 03:34 where I am 100% sure no one was working on it. But as said, it has also happened during the day
The bottom bit of our .htaccess file is changed from:
[CODE=apacheconf]
# php -- BEGIN cPanel-generated handler, do not edit
# Set the "ea-php73" package as the default "PHP" programming language.
AddHandler application/x-httpd-ea-php73___lsphp .php .php7 .phtml
# php -- END cPanel-generated handler, do not edit
to [CODE=apacheconf]# php -- BEGIN cPanel-generated handler, do not edit # Set the "ea-php54" package as the default "PHP" programming language. AddHandler application/x-httpd-ea-php54___lsphp .php .php5 .phtml # php -- END cPanel-generated handler, do not edit
But the really weird bit is that it still shows as php 7.3 in both cPanel and WHM screens. Just now when checking I have realized that the two domain that it has happened on both have subdomain that use the older version of PHP so it is likely this is related. To fix the issue, we set the site back to and older version and then back to 7.3 again. To re-iterate... the above does not change, only the .htaccess changes (when the problem happens). Any help will be appreciated.
to [CODE=apacheconf]# php -- BEGIN cPanel-generated handler, do not edit # Set the "ea-php54" package as the default "PHP" programming language. AddHandler application/x-httpd-ea-php54___lsphp .php .php5 .phtml # php -- END cPanel-generated handler, do not edit
But the really weird bit is that it still shows as php 7.3 in both cPanel and WHM screens. Just now when checking I have realized that the two domain that it has happened on both have subdomain that use the older version of PHP so it is likely this is related. To fix the issue, we set the site back to and older version and then back to 7.3 again. To re-iterate... the above does not change, only the .htaccess changes (when the problem happens). Any help will be appreciated.
-
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? 0 -
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. 0 -
Yeah I asked him. He says he's deleting everything when he reloads his app. SMH 0 -
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. 0 -
They have been advised. Should we set our default to 7.4? I don't want to break anyone's site however. 0 -
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. 0 -
Thanks for your help. Much appreciated. 0 -
You're very welcome! I'm glad I could help get things pointed in the right direction. 0
Please sign in to leave a comment.
Comments
38 comments