View Full Version : imagecreatefromjpeg failing on new server...

08-31-2007, 04:33 AM
I have a really odd problem... This code right here is failing if the Filesize is above some amount. On my old server I could upload ridiculously big images and this would all work fine.

No error message or anything, the script just dies... *Note: It still works for small images, while it will just go blank without an error message with a 700kb image.

Edit: I did more testing, and it's not sized based... I think it fails if the image is above certain dimensions.

//Heres the part where it dies...
echo "Anything?"; //Echo's properly...
if ($imageType == 2){
$imagen = imagecreatefromjpeg("eventPhotos/latest.img");
$imaget = imagecreatefromjpeg("eventPhotos/latest.img");
} else if ($imageType == 1){
$imagen = imagecreatefromgif("eventPhotos/latest.img");
$imaget = imagecreatefromgif("eventPhotos/latest.img");
} else {
echo "<center><h1>Unsupported image format.</h1></center>";
echo "Anything Again?"; //This doesn't appear... Script died... Without an error message.

08-31-2007, 04:36 AM
Turn on error_reporting(), and check your phpinfo() to see if Exif & PCRE are installed/enabled.

08-31-2007, 05:04 AM
Both exif & PCRE are identical on both. Working on turning on error logging...

08-31-2007, 06:02 AM
Heres my php.ini on my server where everything works correctly...

Heres my php.ini where I have these problems...

08-31-2007, 06:24 AM
Solved Problem 1:
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = On

That was Off.

Now, as for problem 2. Heres the exact problem... When I upload a image above a certain size, it uploads it and just shows a blank page. And, no... It's not above the 2MB file limit.

I have no idea what is causing this one...

08-31-2007, 02:45 PM
You would need to post the upload form and the code responsible for handling the upload for anyone here to have a chance of providing any help with why it is not working.

Did you ever get the full php error reporting turned on and/or check your web server log for any errors that would point to what was happening in the code?

08-31-2007, 11:47 PM
Solved that too...

The server administrator hadn't changed the 8MB default memory allocation so there wasn't enough memory to do the operation.

Theres 1500MB free out of 2GB on the server, how much should be allocated to PHP? PHP is going to be pretty much all thats run on this server. I had him set it to 128 for now.