Re: PHP + Cron jobs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
> > This is something that I've noticed for awhile, but last post to this
> > mailing list reminded me that someone probably already knows how to
> > work
> > around this!  I have a cron job that looks something like
> >
> > 12 6 * * * php /home/foo/temp.php
> >
> > But even if temp.php doesn't output anything, I still get emails from
> > the crontab that consist of
> >
> > "Content-type: text/html"
> >
> > I assume this is happening because it's interpreting as a web page or
> > some such.
>
> Somehow your /home/foo/temp.php isn't running with the correct PHP
> interpreter.
>
> > Is there a better way to set the crontab so I don't get that
> > output?
>
> You can always use MAILTO= to direct any output from a cronjob.
>
I actually am using MAILTO, and that's where the problem is.  A cronjob only
mails when there actually is output, which I'm fine with.  In fact, when I
run php temp.php from the command line, I don't get any output.  But when
it's part of the cronjob, there's that content-type output, which triggers
mail to me.

You mentioned a correct php interpreter above.  Should I instead be running
php through some other way or with a specific flag?

Waynn

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux