I have two PHP cron jobs running. In one cron job, am trying to open a file and write some data into it which works fine.
But in the other file, I have added an error_log() statement which is not getting printed into the log file. But the error_log file is getting updated when i manually run this php file. What could be the problem here that it doesn't write to the error_log.txt file only for cron job cases. [Note: The error_log.txt gets updated when i run the php file manually ]
Working cron:
<?php
$fp = fopen('/home/victor/public_html/victor_php/test/test.txt', 'a');
fwrite($fp, ' Cron test job ');
fclose($fp);
?>
Not Working cron:
<?php
error_log("Cron1 test job",0);
?>