Author Topic: [Request] How to Setup whmcs Cronjob in CWP crontab?  (Read 7506 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
[Request] How to Setup whmcs Cronjob in CWP crontab?
« on: July 29, 2019, 01:42:23 PM »
Hi team my whmcs cron donīt work could you help me which is the right path?.

this is my cron job: */5 * * * * /usr/bin/php -q /home/anava/public_html/app.mydomain.co/crons/cron.php


« Last Edit: July 29, 2019, 01:44:01 PM by Anava »

Offline
*
Re: [Request] How to Setup whmcs Cronjob in CWP crontab?
« Reply #1 on: July 29, 2019, 03:41:16 PM »
Solved I add the following path works for me: opt/alt/php-fpm71/usr/bin/php -q

and the cron job looks like this:

*/5 * * * * opt/alt/php-fpm71/usr/bin/php -q  /home/anava/public_html/subdomain.**yourdomain**.co/crons/cron.php

I hope that works for you! :)

Offline
*
Re: [Request] How to Setup whmcs Cronjob in CWP crontab?
« Reply #2 on: January 12, 2020, 05:14:59 PM »
Hi,

I have the same issue, but not only in WHMCS. In fact, any of my cron jobs on any server or account is running.

Code: [Select]
cat /var/log/cron
the cron log is:

Code: [Select]
Jan 12 14:00:52 forseti crond[77]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 68% if used.)
Jan 12 14:00:52 forseti crond[77]: (CRON) INFO (running with inotify support)
Jan 12 14:01:01 forseti CROND[992]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:01:01 forseti CROND[993]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:02:01 forseti CROND[1091]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:02:01 forseti CROND[1092]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:03:01 forseti CROND[1431]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:03:01 forseti CROND[1430]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:04:02 forseti CROND[1540]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:04:02 forseti CROND[1541]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:05:01 forseti CROND[1640]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:05:01 forseti CROND[1639]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:06:01 forseti CROND[1751]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:06:01 forseti CROND[1750]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:07:01 forseti CROND[1857]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable
Jan 12 14:07:01 forseti CROND[1856]: (CRON) CAN'T FORK (child_process): Resource temporarily unavailable

I research for several different causes for this output, most of the solutions is increasing the security limits or UserTasksMax but doesn't work for me.

Do you have configured or personalized some security limits?

Offline
*
Re: [Request] How to Setup whmcs Cronjob in CWP crontab?
« Reply #3 on: Today at 09:16:50 AM »
Had this same issue as well.
I manually ran the cron using SSH
Code: [Select]
/usr/local/bin/php -q /home/XXXXX/public_html/clients/crons/cron.php
Which gave the error
Code: [Select]
Site error: the ionCube PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking.

Please visit get-loader.ioncube.com for install assistance.

So i then searched for a php version with ionCube

Code: [Select]
find /usr/ -type f -name "php" 2>/dev/null | grep bin
/usr/local/bin/php
/usr/local/cwp/php71/bin/php

so I checked if it had ionCube

Code: [Select]
/usr/local/cwp/php71/bin/php -v
PHP 7.2.30 (cli) (built: Apr 29 2020 02:29:42) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with the ionCube PHP Loader + ionCube24 v13.0.2, Copyright (c) 2002-2023, by ionCube Ltd

Which it does so i can update my cron to:

Code: [Select]
/usr/local/cwp/php71/bin/php -q /home/XXXXX/public_html/clients/crons/cron.php

So now my Automation works in WHMCS

Offline
*****
Re: [Request] How to Setup whmcs Cronjob in CWP crontab?
« Reply #4 on: Today at 02:22:11 PM »
If you need a more modern version of PHP (e.g. 8.3) for your cron jobs, Starburst has a guide for building it with IonCube support here:
https://starburst.help/control-web-panel-cwp/control-web-panel-cwp-admin-tutorials/ioncube-error-after-building-php-8-3-with-cwp-on-almalinux-8-9/