[SOLVED] Adding images larger than 1MB?

jalefkowit

Joined: 2005-03-18
Posts: 5
Posted: Fri, 2005-03-18 21:26

Hey --

I've been playing around with G2 and so far it seems really great, except for one pretty significant issue I've run into -- every time i try to add an image bigger than 1MB or so, the add-image script chokes.

Doesn't matter if I add through the web form, the java applet, or Gallery Remote, the end result is always the same. Also doesn't matter if I tell it to pre-generate thumbnails or not.

I've seen in other threads that there might be some issues with 6.x versions of ImageMagick (I'm on 6.1.9), so I tried pushing IM down the priority stack, and then disabling that module altogether. Neither one did it.

Then I tweaked php.ini to increase the max file upload and max post data parameters. That didn't solve the problem either.

Then I tried switching browsers between IE and Firefox to see if it was a client-side issue. Nope.

I'm at wit's end. Help! :D

-- Jason Lefkowitz

----

Gallery URL (optional):
Gallery version: G2 Beta 1
Webserver (with version): Apache 2.0.46
Datatabase (with version): MySQL 3.23
PHP version (eg 4.2.1): 4.3.2
phpinfo URL (optional):
Graphics Toolkit(s): NetPBM, ImageMagick, GD
Operating system: Red Hat Enterprise Linux 3
Web browser/version: IE6, Mozilla Firefox 1.0.1
G1 version (for migration bugs):

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-03-19 01:15

try disabling Gd or increasing the memory limit for PHP.

 
jalefkowit

Joined: 2005-03-18
Posts: 5
Posted: Sat, 2005-03-19 01:24

Already tried both (sorry, shoulda mentioned that). Neither worked. PHP memory limit is up to 24MB, is that high enough?

BTW, realized I made a mistake in my footer on the first post in this thread... Win2k is my workstation OS, I'm running Gallery on Red Hat Enterprise Linux 3. Sorry 'bout that.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-03-19 02:44

what is "add-image script chokes".. hard to tell what's wrong from that..
try turning on buffered debug output in config.php and look for error messages in the output when it is building thumbnails, etc.

 
jalefkowit

Joined: 2005-03-18
Posts: 5
Posted: Sat, 2005-03-19 09:13

The exact failure behavior is: when I try to upload an image of size greater than 1MB using the Web form, I get back either a "Cannot find server or DNS Error" page (in IE) or a "Document contains no data" error dialog (in Firefox).

I have buffered debug output turned on, but since I'm not getting back an actual G2 page when it fails, there's no debug output to report...

It doesn't seem to be related to building thumbnails since it happens when I un-check "Create thumbnails now", too.

When I try uploading the same images thru the Java applet, they fail too. Here's the error I got when I just tried:

Error: java.io.EOFException: Premature EOF encountered

This is not the error I had been getting on the other PC I was using most of the day (there it was "connected to server but could not find Gallery" or some such). But the behavior was the same, it would upload a few bytes, stall, and then give me the error message. Maybe different JVMs on the client give different errors?

I've been working primarily with JPEG images, so this may be limited to that format.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-03-19 10:07

1. try immediate debug output
2. check webserver error log
3. what does add-from-browser say about upload limits?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-19 11:26

mindless, this seems to be a server setup specific problem. on my webhost, i can upload big files without a problem. but on my personal webserver at home, i get in firefox "document contains no data" error.

When trying to upload with the upload applet, i get this error

walenstadt_2001_19.png: Error: HTTP POST failed (HTTP 413 Request Entity Too Large )
i.e. it doesn't seem to be related to php, but to apache!

my php config allows large files.
but in get this error for images larger than about 400 kbyte!

investigating...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-19 11:31

from the G1 FAQ comments:

 HTTP POST failed HTTP 413 Request Entity Too Large

If you get this message when trying to upload a file. Check a few files. Make sure that your php.ini file has post_max_size & upload_max_filesize set to the file size limit you want. You may also have to edit some addtional files suchas; php.conf (RedHat 8 /etc/httpd/conf.d/php.conf) or 70_mod_php.conf file (Gentoo /etc/apache2/conf/modules.d/70_mod_php.conf). In those conf files you're going to want to set all the lines of code that contain LimitRequestBody to "LimitRequestBody 0". I have found If you don't have one of those conf files set your upload will be limited. Well, I hope this helps!
 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-19 11:33
 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-19 11:38

ok, this solved it for me (i'm using apache2):

add these lines to your .htaccess file:

<Files *.php>
  LimitRequestBody 8388608
  RequestHeader unset If-Modified-Since
</Files> 

8388608 is for a limit of 8 MegaByte. For x megabyte, set it to x * 1024*1024.

 
jalefkowit

Joined: 2005-03-18
Posts: 5
Posted: Sat, 2005-03-19 13:06

w00t! the .htaccess tweak fixed it! thanks! 8)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-19 13:14

could you edit your first post of this thread and change the title to "[SOLVED] Adding images larger than 1MB?"

 
jalefkowit

Joined: 2005-03-18
Posts: 5
Posted: Sat, 2005-03-19 22:42

Looks like some kind admin already did it for me :)