Jump to content

System Health - Reporting Warning with error display not enabled / PHP Mismatch after manually verifying


Recommended Posts

Hello everybody - I just kind of let WHMCS do its thing and over time that's been great for my modest needs.  However I started reviewing the configuration file after discovering I had inadvertantly knocked out my cron by incorrectly moving the cron directory.

I have just amended that and am now doing a inventory of the syustem configuratiojjn to make sure everything os kosher.

1)    I see on the System Health Status screen a warning for PHP Mismatch

Cron PHP Version Mismatch
Your environment appears to be running a different PHP version (7.3.27) for the System Cron than the currently loaded PHP version (7.4.16). This may cause issues running your System Cron.

2)  I also see a Needing Attention alert for Error Reporting 

Error Reporting
Your system is set to display errors. While this is useful for some debugging situations, it can interfere with some operations and is a security risk. For more information please refer to our documentation.

 

3) When I navigate to Pending Module Actions from the main dashboard, the resultant Module Actions screen appears for about 2 seconds and I am redirected to  https://host.MYWHMCSSITE.com:2087  and I see a WHM login screen.

 

*Sorry for the 3 in 1 issues to post.

 

Troubleshooting I've done for 1) above PHP mismatch - I've gone to terminal and verified cpanel is calling a php 7.4 by using the directions here: https://help.whmcs.com/m/automation/l/969680-identifying-the-php-ini-used-for-in-command-line-cron-engine

Multi-php ini in cPanel is set for 7.4 in my home directory and WHMCS install public_html in php.ini / user.ini / .htaccess

CRON in cpanel set to: 

(every 5 mins) 
/opt/cpanel/ea-php74/root/usr/bin/php -q /home/MYSITEHOME/public_html/WHMCS_DIR/crons/cron.php

Also checked Utilities->System->PHP info in WHMCS  and see 

Configuration File (php.ini) Path	/opt/cpanel/ea-php74/root/etc
Loaded Configuration File	/opt/cpanel/ea-php74/root/etc/php.ini

 

 

 

Troubleshooting I've done for 2) above Error Reporting

Configuration->System Settings -> General Settings -> Other  and verified all Error / Debug options at bottom are deselected  ¯\_(ツ)_/¯ 

 

Troubleshooting I've done for 2) above redirect from Pending Module Actions

Not sure where to start with this one...

 

Any suggestions welcomed - thank you for the time.

Link to comment
Share on other sites

PHP running from the command line is a different version from the one running through your web server. The WHMCS admin side will report and use the one running on your web server, but cron will use the one running inside your operating system as default installed version. Depending on your control panel or server setup, they might be different since you can run different PHP versions on the same system.

You should run the cron using the same version as the web server which means you need to slightly modify the cron to tell it the PHP path location. Otherwise, if you don't tell it the path, it will  just use the default one installed.

You can log into your server and run:

php -v 

To see what version is the default. That is not the one you should be using in your cron. I actually found out this issue years back before this was even documented in the WHMCS website.

If you are not sure if your cron path is correct, just log into your server and run the command manually. If you get some errors, its wrong. If you run the PHP version from WHMCS admin side, that PHP info file will tell you the path to that PHP version.

As for the redirecting to WHM from the module, I'm not sure if this is related. Seems like a problem with the module because both of your versions regarding PHP work with WHMCS and modules, this would not be the case of a PHP version mismatch. The worst that can happen if the cron runs a different PHP version but is on the same major version (7.x.x something) is that it's using different PHP.ini settings, and the time might be different between your WHMCS setting and the cron.

Link to comment
Share on other sites

Thanks ygg!

1)    I see on the System Health Status screen a warning for PHP Mismatch

I checked and rechecked and ended up with what I had when I posted

/opt/cpanel/ea-php74/root/usr/bin/php -q /home/MYDOMAINFOLDER/public_html/WHMCSDIR/crons/cron.php

and just waited 24 hours and it seems to have cleared up.  Honestly I did some in WHM as well (this is on a VPS) and not sure which option I might have altered made the difference, not very scientific.  Just followed all advice I could find and waited, now the error is gone.

 

2)  I also see a Needing Attention alert for Error Reporting 

Ended up being in my configuration.php file set to 'true', not in the WHMCS admin GUI

 

3) When I navigate to Pending Module Actions from the main dashboard, the resultant Module Actions screen appears for about 2 seconds and I am redirected to  https://host.MYWHMCSSITE.com:2087  and I see a WHM login screen.

I discovered I had an outdated module addon 'Import Assist' not compatible with latest version 8 WHMCS.  Realized I was  in a bind, couldn't downgrade to the PHP version that was compatible with Import Assist to remove b/c it would be below min PHP for WHMCS.  So I just deleted the Import Assist folder in cPanel file manager, then in WHMCS - I just loaded the Pending Module Actions and clicked on 'Ignore' or 'Mark as Resolved' like 2 or 3 at a time, then page would time out and roll me over to that WHM login, and I'd go back and play that whack-a-mole process until they were all cleared.  Now module actions page will load with nothing present.

 

Thanks again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated