WP Toolkit fails to detect correct PHP version for WordPress websites

Operating System & Version
CloudLinux 4.18.0-477.10.1.lve.el8.x86_64
cPanel & WHM Version
cPanel 112.0 (build 5)

frzsombor

Member
Aug 8, 2023
9
1
1
-
cPanel Access Level
Website Owner
On my web server, the default PHP version is an old version because of some legacy pages.
As on my current setup I can not set different PHP versions for different domains (don't have "multiphp" feature), I use the following workaround:

In the root folder of a (WordPress) website, I insert the following code at the beginning of the `.htaccess` file:
<FilesMatch ".(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php82___lsphp
</FilesMatch>

This way every PHP file in that folder is handled with PHP v8.2 and everything works.
However, WP Toolkit is not detecting this workaround, so it simply shows the following error:

WP Toolkit has found WordPress files at the following path:
Path /home/user/path/to/example.com
However, it does not seem that this WordPress website is working. Try restoring the website from a backup or cleaning up the redundant files.
[error]FailedToExecuteWpCliCommand: exit status 1[/error] Your server is running PHP version [old_version] but WordPress 6.3 requires at least 7.0.0.

Also, on the Dashboard tab, in the Status column, the "PHP version" row shows the global PHP version, not the "overwritten" version.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Hey there! Can you try using the cPanel method to show that instead and see if that works better for you? This is what our .htaccess code looks like:

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

frzsombor

Member
Aug 8, 2023
9
1
1
-
cPanel Access Level
Website Owner
Hey cPRex, thanks for your reply!
I've tried your suggestion (and modified the package to match my servers version).
The PHP selection works indeed, but unfortunately WP Toolkit still can't recognise this overwrite.
 

frzsombor

Member
Aug 8, 2023
9
1
1
-
cPanel Access Level
Website Owner
All right, thanks again, will do.
Are you sure this is not a bug / missing feature with cPanel + WP Toolkit but the result of a wrong server config?
What should I tell them to do or change?
 
Last edited:

frzsombor

Member
Aug 8, 2023
9
1
1
-
cPanel Access Level
Website Owner
I see, thank you for all your help! I also guess this is something global.
Last question: Can you please help me, what would be the best way to report this issue in an official way, so someone can take a look into this?
 

frzsombor

Member
Aug 8, 2023
9
1
1
-
cPanel Access Level
Website Owner
I just got the confirmation from the host: "[...] the workaround method you need to use won't reflect as expected within the WP Toolkit. I suspected this to be the case and have conferred with our Advanced team, getting confirmation that this limitation is outside our control."
Receiving this confirmation, as you suggested, I asked them to submit a ticket to you about this.
Hope it will arrive to you soon.
Thanks again for your help!
 

frzsombor

Member
Aug 8, 2023
9
1
1
-
cPanel Access Level
Website Owner
Today I got an update from my hosting provider.
They were able to reproduce and verify the issue and as you suggested, they've reported this to the cPanel team with ticket #95109324.
 

frzsombor

Member
Aug 8, 2023
9
1
1
-
cPanel Access Level
Website Owner
Thanks cPRex! Sad to hear, thought they would be more cooperative on this.
Still hope maybe someone from cPanel could reproduce this and a fix will be released someday.
 
  • Like
Reactions: cPRex