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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -