Fog Creek Software
Discussion Board

Dispatcho / file upload problems under UNIX

Dispatcho may fail if it receives a large e-mail (eg. with a 4MB attachment) and if PHP has been configurated using its default limits.

The following values in /etc/php.ini may have to be increased:

- max_execution_time
- max_input_time
- memory_limit
- upload_max_filesize
- post_max_size

Note that the memory_limit setting easily exceeds 20 MBytes for large cases !

Also, max_execution_time is ALWAYS EXCEEDED after some time by the dispatchod.php script, since it's never restarted. You therefore have to pass "-d max_execution_time=0" on the command line when you start the dispatcho daemon.

And Iit is a good idea to check from time to time if dispatcho is still running and restart it otherwise.

Daniel Gehriger
Tuesday, January 20, 2004

Excellent points.  I will changed dispatchod to use the max_execution_time and also add notes during install to change those ini settings.

Michael H. Pryor (fogcreek)
Tuesday, January 20, 2004

This just isn't working for me--I've been trying to get this running all day, until I was referred to this message.

I have set PHP to accept attachments up to 12MB and to run for up to 300 seconds, and when I send some attachments of 1-2 MB, here's what happens:

1) This one PHP script begins to use up 45% of my CPU power
2) The bugs themselves get entered but the attachments get lost.

Is there any other way to download email into this system?

Lee Semel
Thursday, January 22, 2004

I also get a new copy of the bug eveyr 300 seconds.

Lee Semel
Thursday, January 22, 2004

Also, max_allowed_packet for your mysql configuration has to be set large enough.

Michael H. Pryor (fogcreek)
Friday, January 23, 2004

I'm working on the installer to make sure these things are documented to the user during install.

I am also beefing up the error handling for dispatcho so we know when something is wrong.

And finally, I've written a checklist to go over if something goes wrong:

Michael H. Pryor (fogcreek)
Friday, January 23, 2004

Here is another source of troubles. If you find that medium to large sized attachments are corrupted, this could be to a bug in PHP in combination with Apache 2.

If in the Apache configuration files, you both set

mime.types:application/x-httpd-php php


SetOutputFilter PHP

, data sent by using a HTTP POST will be corrupted. If you post, eg "msg=..................", you'll end up with "msg=.........msg=...............". The corresponding variable in PHP will contain its own variable name as its value ($msg contains something like "..........msg=.............." )

The workaround is not to use "SetOutputFilter PHP".

- Daniel

Daniel Gehriger
Thursday, January 29, 2004

*  Recent Topics

*  Fog Creek Home