简体   繁体   中英

How can I know the errors in cron script

I am trying to run the cron script. I get an email everytime cron runs but I realise that the script does not run via cron job. However, when I try to run that script using browser direct link, it works fine.

I just wondering that how can I know what is happening in background when cron runs?

I tried to write it to log file but this either does not work !

ini_set("log_errors", 1);
ini_set("error_log", "/tmp/php-error.log");
error_log( "Hello, errors!" );

Any help?

I think you have some path issue. Add your email id where you added cron job in cpanel. Then they will email you the bug when cron job runs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM