Jump to content

Cron invocation WHMCS - advanced and expert users only - please advise


Go to solution Solved by zitu4life,

Recommended Posts

Hello there

Have you ever faced similar crazy issue like this!!!!!

It is been 6 days and no solutions. My WHMCS insists and give me headache regarding cron invocation and no one is able to find a solution (6 days with this issues so far).

I updated my WHMCS that was on version 8.5 (using php7.4) to version 8.8 (also start using php8.1 for the first time on my installation). Installation were made using browser auto update following oficial tutorial and everything was OK.

Over last 3-4 years I have been usingĀ  WHMCS on VPS and took decision to leave VPS and moove to reseller package bundle with WHMCS license. Migration was smooth made by hosting specialist support.

After updating WHMCS I proceed with migration from another server with another IP address.

On this new server I am having cron issues that never imagine headache like this, that no one is able to find root cause and a solution.

My hosting support specialist inspected my cpanel account and nothing shows wrong, cron logs shows that cron invocation happens.
WHMCS support can't be able so far to point possible root cause.

My development instalation that still running on same server after migration too was working with cron with no fail using php72..šŸ™ƒ...after note that I tried to test php72 onĀ  my main website and it worked with no fail also...

So my situation is that now cron only works on php72....not work on php73...not work on php74 and not work on php81

I can not leave with php72 on 2023, please if you think I should start loot at something please advice.

I do not intend revert migration to VPS again due too higher costs envolved, so hope I can find a solution.

Is there any php extention that are related to cron that I should look at?

My cpanel are invoking a cron on all php version but WHMCS only detected pit on php72 I guess...

PS: when enforcing cron to run it responds completing all tasks

My active WHMCS ticketĀ #IXY-976942

image.png.17fd4ce8de1684d6475280a80cefec4e.png

Ā 

Ā 

Ā 

Link to comment
Share on other sites

If it works with PHP 7.2, it sounds like some third party code not being compatible with newer versions of PHP.

I would do the following:

  1. Clone your current WHMCS installation to a dev environment on the same server
    1. Remember to set the needed paths to cron.php and what not
  2. Run the cron job manually (/opt/cpanel/ea-php81/root/usr/bin/php -q /path/to/dev/cron.php -F -vvv) - it should still fail at this point
  3. Disable hooks
  4. Test cron again
    1. If it works, one of your hooks was the issue. Enable the hooks one after one until it stops working - you now know which hook is the issue
  5. With the hooks still disabled, disable all of your modules. You might need to actually move the module files out of the "modules" folder
  6. Test cron again
    1. If it works, one of your modules was the issue. Enable the modules one after one until it stops working - you now know which module is the issue

At this point, your cron should have completed at least once.

If it hasn't, make sure that you have all of the necessary PHP extensions enabled: https://docs.whmcs.com/System_Requirements

Link to comment
Share on other sites

Hi @DennisHermannsenĀ thank you for taking your time and efort to read and point some possible cause of my issues...

At this time I have disable all hooks and all modules, cruently I am only using 2 modules and have switched them off during this trobleshooting...

Now I find out that my WHMCS are point meĀ systemhealthandupdates.phpĀ a Cron PHP Version Mismatch what looks to be root cause maybe....

But I have it configured right I guess..please look at my 2 print below... If WHMCS says there is a mismatch means that my server could be running cron at php72 even in my cpanel are right? My hosting administrator can resolve this issue???? what should I say to my hosting adminsitrador to change exactly?

image.png.4c17163bd10e52da753319b74767b6b8.png

--------------------------------

on cpanel I have this...

image.png.1aca29e298f3b3854b311cb55eae0520.png

on cpanel cron I have this...
image.png.548e838945ffa273826208a72119b708.png

How can I enforce cron mismatch syncronization?

PS: my cron runs 15 to 15 minutes due to hosting polices, but no problem with that.

Why WHMCS detects mismach if I gave it correctly, and it answer automaticaly why it works ONLY on php72, because on php72 will match CRON

Link to comment
Share on other sites

My hosting provider just informed me that they can notĀ Ā change the version of the server from 7.2 to 8.1 since there are many customers on the server.Ā For god sake!!!

Does WHMCS plataform can run cron even if there is a mismatch for example?

My server has cron 7.2 and I am running loaded PHP version (8.1.22).

Link to comment
Share on other sites

Your screenshot from cPanel shows two different PHP setups. "PHP Selector" is CloudLinux' PHP called 'alt-php'. The screenshot from the cron job is cPanel MultiPHP 'ea-php'.

Your host should not be forced to set the default PHP to anything specific. Both PHP Selector and MultiPHP allows for you to configure the PHP version manually. If you open your website's .htaccess, does it say ea-php or alt-php at the bottom?

Ā 

Link to comment
Share on other sites

2 quick thoughts:

1) Should you be using /opt/cpanel/alt/php81/ (which you currently have) or /opt/alt/php81/ ?

2) Your .htaccess file is a hidden file located in the same folder as your configuration.php file - in cPanel File Manager, click the Settings button in the far upper right corner of your screen and make sure the box is checked for Show Hidden Files (dotfiles)

Since you're not familiar with that file, select it and choose the View option the first time to look things over rather than going straight to edit.

I also found this link that I think answers #1 above: https://forums.cpanel.net/threads/cron-version-mismatch-nginx-issues.679809/post-2881169

Link to comment
Share on other sites

thank you guy for keep following up with me...

16 minutes ago, Evolve Web Hosting said:

1) Should you be using /opt/cpanel/alt/php81/ (which you currently have) or /opt/alt/php81/ ?

You are right I have correct it by it only run cron if I realized testing on my dev that it requires to useĀ /opt/cpanel/ea-php

PS: It looks my dev installation on same server are able to run cron using cron php72 and also php loader php8.1 just tested it....

asĀ Ā I did not find anything confiential here is what I have , some values I have tryed to use diferent values as testing purpose., please see if something can help..

image.png.989e37b8828a65bd8e8fa02f79b38c71.png

Edited by zitu4life
Link to comment
Share on other sites

Forgive me if I'm missing something or not. Do you have it working now?

If you're using cPanel to change your PHP version (Easy Apache) which it does not look like you are, you would use /opt/cpanel/ea-php81/ (remove /alt/ and add ea- before the php version)

Based on the screenshot in your 2nd post, you're using the CloudLinux version of PHP 8.1 so you would use /opt/alt/php81/Ā  instead. You can also confirm this by logging into your control panel, go to PHP Selector (for CloudLinux) and click the Options tab. Scroll down and look at the format for include_path - it should start out as /opt/alt/php81/ and that's your clue that this is the format to use with your Cron command as well.

Did you go through these troubleshooting steps? https://help.whmcs.com/m/64751/l/683269

Your hosting company should be able to quickly give you the correct command. What is their response?

Link to comment
Share on other sites

thank you all for keeping supporting me.

defenitely I should useĀ Ā /opt/cpanel/ea-php72/root/usr/bin/php -q /home/fakeuser/public_html/crons/cron.php despite using cloudlinuxĀ āœ”ļø

But I was thinking that it is mandatory to match php version and cron version to WHMCS works, but my dev proves not.

On my dev running on same server I have php loader 8.1 and cron php version 7.2Ā šŸ™„

And My production website I tried the same and not work.

PS: My website production running WHMCS v8.8 lastest version and my dev are running v8.7

I will try update my dev to v8.8 and see if it will starts fails..

This issue is getting me crazy, because cron is important from my business.

Edited by zitu4life
add and see if it will starts fails..
Link to comment
Share on other sites

  • Solution

Hi guys... @DennisHermannsenĀ and @Evolve Web HostingĀ many thanks for following up with me....I think I have address my issue, but good is to wait at least 24 hours. I have learn a lot of these last 6 days getting crazy with CRON not working...

Have tried a lot of things...and you guys make me thing out of the box!!

While WHMCS support was pointing me to look at cron logs and alsoĀ 

vvv >> crondebug.txt

which wasn't been recorded due to cron was even tries to start to be logged...I have to make lot of tests because have happened:

1.Ā  WHMCS update
2. Server Migration
3. Changing from VPS that can ran al version of cron to reseller that is managed by hosting provider that has it only working on php72 by internal polices.

All these things make it hard make cron work again easily.

How I adress this.

First: testing all php version I find out that on php7.2 cron will run, this mean I will be slave of my hosting provider, if someday it stops sudenly I need to test if hosting provider has changed it php73 php74 or php81 but I can leave with thatšŸ˜…

Second: After re-uploading all WHMCS files again it starts working, so I suspect that as I was using cron folder localy instead on public_html folder, during browser auto-update cron folder remains from WHMCS v8.5 that I suspect was not compactible with WHMCS v8.8...I know that during all trobleshooting I moove cron folder to public_html for testing purpuses and perhaps I did not use new cron folder from v8.8 and keeping using cron folder from v8.5 due perhaps some mistake (tired mind šŸ˜·)

Third: After re-uploading all folder installation it replaces cron old folder from whmcs v8.5 and like magic cron starts works again.šŸ‘ŒĀ 

Will wait 24hours, leaving it overnight but I am confident that it is OK now.

PS: Would be nice if WHMCS during browser auto-update advise you...We detect that cron folder is not on default folder, remember to update it after installation!!!

Thanks to WHMCS support team, thanks to my Hosting support specialist, thanks to WHMCS community users. Hope now I can activated a automatic pilot 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