John,
> Here is my cron command set to run every minute.
>
> cd /opt/lampp/htdocs/eventum/misc; /opt/lampp/bin/php -q
> download_emails.php support 172.16.10.3 INBOX; /opt/lampp/bin/php -q
> download_emails.php --fix-lock
>
> The reason I have set it to run every minute is that the job only
> fetches one mail at a time and then locks-up. Hence the unlock
> procedure.
>
> Q: Is there a reason for it not fetching all the mail and locking like
> it does?
>
> Q: If there is how do I fix it and not have a sloppy cron fix
> like I do?
>
Yeah, the reason is probably related to PHP's memory_limit setting. By
default it is set to 8 megabytes, I believe, so a somewhat large email
message (or even 2 small email messages) might increase the memory usage
above this limit, killing this script.
What you need to do is to remove that --fix-lock for now, to see if the
following fix will work correctly:
- open download_emails.php and add this line:
ini_set("memory_limit", "512M");
--Joao
| Thread |
|---|
| • Cron | John Mitchell | 19 May |
| • RE: Cron | Joao Prado Maia | 19 May |
| • Re: Cron | bart | 19 May |
| • Re: Cron | Elan Ruusamäe | 19 May |
| • RE: Cron | Joao Prado Maia | 19 May |