About Cron Job

Hi..

Just ask.

Before this (on old server) my cron job like this

/usr/bin/php-cli -q /home/smtech5/public_html/mydomain.com/mails/apps/console/console.php send-campaigns >/dev/null 2>&1

When I move mailwizz to new server, my cron job become like this.

/bin/php -q /home/smtech5/public_html/mydomain.my/mails/apps/console/console.php send-campaigns >/dev/null 2>&1

Why "usr/" and "-cli" missing? Any Problem?

 
Hi..

Just ask.

Before this (on old server) my cron job like this

/usr/bin/php-cli -q /home/smtech5/public_html/mydomain.com/mails/apps/console/console.php send-campaigns >/dev/null 2>&1

When I move mailwizz to new server, my cron job become like this.

/bin/php -q /home/smtech5/public_html/mydomain.my/mails/apps/console/console.php send-campaigns >/dev/null 2>&1

Why "usr/" and "-cli" missing? Any Problem?
# php-cli is at different locations depending on how your server is installed/provisioned
# check where your php-cli is by using this command:
whereis php-cli
# or
which php-cli
# then check it out with
.../.../php-cli -v
# it should show you the clean version info of the php-cli
# then use that path, even if mwz shows other info in the crons info
;)
 
@David Henry - seems to be /usr/local/bin/php in your case.
if you run /usr/local/bin/php -v and you see the wording (cli) in the output, then that's the correct one.
 
You will find the correct path if you go in mwz to
/backend/misc/phpinfo
and there you will see a section
"Environment" with row 'path'
and another section
"php variables" with row 'server path'
That will tell you all you need to know.
Sometimes the php for cgi-fcgi does not work for the cron jobs...but the php-cli does.
 
It's the same, weird things going on there.

Let's try:
Code:
/opt/cpanel/ea-php56/root/usr/bin/php -v

and

Code:
/opt/cpanel/ea-php56/root/usr/bin/php-cli -v
 
It might be best to first fix the whole php install, for which you go to whm easyapache and get rid of the v5.6 and only use the v7, make sure you have all important modules checked, maybe the cli module is missing.
php-cli=OK.jpg
 
@David Henry - so eventually
/opt/cpanel/ea-php56/root/usr/bin/php is the correct CLI binary.
You can use
/opt/cpanel/ea-php70/root/usr/bin/php to access the php 7 binary.
 
/opt/cpanel/ea-php70/root/usr/bin/php
For cron, Do i need to add it like

/home/inboxingpro/public_html/mailer/apps/console/console.php send-campaigns >/dev/null 2>&1

* * * * * /usr/local/bin/php (instead of this)

***** /opt/cpanel/ea-php70/root/usr/bin/php -q /home/inboxingpro/public_html/mailer/apps/console/console.php send-campaigns >/dev/null 2>&1

Thanks
 
I think it should work with this now, after the version fix (incl the cli module):
* * * * * /usr/local/bin/php -q /home/inboxingpro/public_html/mailer/apps/console/console.php send-campaigns >/dev/null 2>&1
The cron jobs list should be ok now too:
/backend/misc/cron-jobs-list
 
Back
Top