Mailing List Archive


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

Re: [tlug] Efficiently executing a cron job on my webhosting server



> email address to receive any error output or notifications. This seems like
> a good thing, but I've learned that it sends me a message even when the PHP
> script runs successfully, which I don't really need to know all the time.

If php doesn't output anything (*) then no email gets sent.

*: Not sure about whitespace, but I assume not even a single space. So
check for a carriage-return after the closing "?>" tag.

> The message it sends me has this in the body:
> X-Powered-By: PHP/5.1.4
> Content-type: text/htm

This means you have the cgi version; those headers are the only
difference IIRC. You can suppress it with "-q". E.g. "php -q
/path/to/myscript.php"

> Also, I think this may be related, I want to make sure the PHP script
> cleans up after itself and doesn't use up any memory or create any 
> temp files that stick around after it's done.

Allocated memory goes back to the OS when the script stops running. And
if you are not using sessions then PHP should clean up any temporary
files it creates.

PHP sessions will create a file under /tmp, which persists (that is the
point of sessions). PHP itself should notice and clean them up at some
point after the session has expired. But if not, the OS will purge /tmp
regularly.

Darren



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links