apocryph.org Notes to my future self

6Nov/050

Can't upload large files to Gallery2

When I upload large files to Gallery (meaning roughly > 2MB) from Gallery Remote I get an upload error. Upon checking /var/log/httpd-error.log, I see:

PHP Warning: POST Content-Length of 8503267 bytes exceeds the limit of 8388608 bytes

In /usr/local/etc/php.ini there’s this line:

  ; Maximum size of POST data that PHP will accept.
  post_max_size = 8M

8M seems plenty, but apparently there’s a helluva lot of overhead associated with uploading an image. I’ll double it, to 16M:

  ; Maximum size of POST data that PHP will accept.
  post_max_size = 16M

Hmm….the error msg is gone but I’m still getting meaningless ‘upload failed’ errors…I think the error msg was from a couple of MPEG videos which were in fact more than 8MB; my photos are <3M but still failing…
I’ve uncommented error_log = syslog in php.ini; perhaps that will clarify things.
No; nothing new in httpd-error.log
Aha, there’s another php.ini settings. post_max_size is the maximum length of the POST form data, but upload_max_filesize controls the max size of a single file uploaded via POST. On bonzo, it’s 2M. I’ll make it 16M:

  ; Maximum allowed size for uploaded files.
  upload_max_filesize = 16M

Yup, that did it. Works now. I wish the error msg would’ve been somehow apparent; it’s as though Gallery or PHP simply eat the failure.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.

Delicious Bookmarks

Recent Posts

Meta

Current Location