CyberPanel Community

How to find the valid php path of a cron job

ch
changlee #1

Hello,
I am trying to set the right cron command for the nextcloud cron. The setup suggest:

crontab -u www-data -e

*/5 * * * * php -f /var/www/nextcloud/cron.php

a) I am using PHP7.3 in CyberPanel. How can I find the right path of the PHP please?
b) How can I check if the Cron runs fine?

10 replies
th
therealgilles #2

It will usually look something like this:
/usr/local/lsws/lsphp73/bin/lsphp

th
therealgilles #3

By default, cron jobs will send emails to their associated user if an error occurs.

ch
changlee #4

Very thank you for your help.
How can I verify if the cron is executed please?

Di
Diego #5

Use terminal and the command “whereis php”

ch
changlee #6

Hello,
I received:
php: /usr/bin/php

How can I verify that my cron is excuted? Thanks!

Di
Diego #7

You can test the cron executing any file and then looking into the server logs.

ch
changlee #8

Thanks, I have set some crons for wordpress sites and the crons are not working. So where exactly are the server logs please?

us
usmannasir #9

/usr/local/lsws/logs/

am
amarnath007 #10

hellow can you help me i use cornjob in project and add command echo “CyberPanel”>/home/check.in/public_html/public/test.php but this command rewrite entire file
i also use /home/check.in/public_html/public/test.php this command also but my code was not running every minute for sending email. test.php file contain php code for sending mail please help me

Sign in to reply