PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Aug 13, 2020 7:18 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Jun 19, 2005 5:52 am 
Offline
Forum Newbie
User avatar

Joined: Sun Jun 19, 2005 3:49 am
Posts: 4
Hi guys,

Nice place you have here. First poster.

I've got a problem with imagecreatefromjpeg() dying with an internal server error on images with fairly large dimensions (say 2000x1500). My resoures in php.ini are set fairly high and I've noticed that large dimensions make it fall over and not file sizes. Anyone have any clue as to what might be causing this or if it's indeed a known issue? I've narrowed down the problem in the script to the line containing imagecreatefromjpeg(), so I know it's the culprit.

I'm running PHP 4.3.10 (compiled with all the supporting GD stuff) on rh9.

Thanks for any pointers.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 6:28 am 
Offline
Jedi Mod
User avatar

Joined: Tue Dec 21, 2004 6:03 pm
Posts: 5263
Location: usrlab.com
It is almost certainly doing one of two things. Either it's running into PHP's memory limit (http://uk.php.net/manual/en/ini.core.ph ... mory-limit), or the script is timing out (http://uk.php.net/manual/en/ref.info.ph ... ution-time). What settings do you have for these?

I've created images much large that that using GD2. It definitely can handle things that size.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 7:01 am 
Offline
Forum Newbie
User avatar

Joined: Sun Jun 19, 2005 3:49 am
Posts: 4
hmmm...I've max_execution_time and max_input_time at 120 and the memory limit at 64M. The picture's actually quite small (80KB), and the script gives the 500 error only a few seconds after I upload it, which makes me wonder if it's indeed a resource problem. Other pictures that are 1024x768 and over 1MB upload just fine.

Any other ideas? Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 7:45 am 
Offline
DevNet Master

Joined: Tue Jan 20, 2004 12:11 am
Posts: 4897
Location: Leuven, Belgium
What do you recieve if you prepend the following to your code?

Syntax: [ Download ] [ Hide ]
ini_set('error_reporting', E_ALL);

ini_set('display_errors', TRUE);


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 8:58 am 
Offline
Forum Newbie
User avatar

Joined: Sun Jun 19, 2005 3:49 am
Posts: 4
The problem is that the 500 error is displayed right after the function is called so there's no chance to see what the errors might be. php.ini is already set up to pipe all errors to the browser.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 9:04 am 
Offline
Jedi Mod
User avatar

Joined: Tue Dec 21, 2004 6:03 pm
Posts: 5263
Location: usrlab.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 9:09 am 
Offline
DevNet Master

Joined: Tue Jan 20, 2004 12:11 am
Posts: 4897
Location: Leuven, Belgium


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 19, 2005 1:04 pm 
Offline
Forum Newbie
User avatar

Joined: Sun Jun 19, 2005 3:49 am
Posts: 4
Spot on. Makes me wonder why I didn't look in the error logs to begin with. There was an error parsing php.ini because of a line that had split across two lines.

All's well now. Thanks both for the replies.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group