php - How to email output from shell_exec()? -
with cron jobs, output of file being executed emailed me. discovered via this answer it's possible asynchronously execute php file using shell_exec()
function. per above answer, i've been using following command:
shell_exec('php /file/path.php parameter1 parameter2 > /dev/null 2>/dev/null &');
i think of interest regards question stuff @ end:
> /dev/null 2>/dev/null &
is there way change output emailed, cron job?
the line
> /dev/null 2>/dev/null &
essentially sends output null file. if take bit off, output sent standard out, should in turn should email results assuming run cron job.
so,
shell_exec('php /file/path.php parameter1 parameter2');
if you're not running cron job, you'll need build in email functionality script itself.
Comments
Post a Comment