Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Posts
    135
    Thanks
    1
    Thanked 0 Times in 0 Posts

    imagecreatefromjpeg failing on new server...

    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.

    Code:
    //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.
    Last edited by iceflyin; 08-31-2007 at 07:40 AM.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Turn on error_reporting(), and check your phpinfo() to see if Exif & PCRE are installed/enabled.
    Last edited by Inigoesdr; 08-31-2007 at 04:39 AM.

  • #3
    Regular Coder
    Join Date
    Jul 2007
    Posts
    135
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Both exif & PCRE are identical on both. Working on turning on error logging...

  • #4
    Regular Coder
    Join Date
    Jul 2007
    Posts
    135
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Heres my php.ini on my server where everything works correctly...
    http://www.designermichael.com/php.ini

    Heres my php.ini where I have these problems...
    http://www.designermichael.com/Anotherphp.ini

  • #5
    Regular Coder
    Join Date
    Jul 2007
    Posts
    135
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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...
    Last edited by iceflyin; 08-31-2007 at 06:39 AM.

  • #6
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,146
    Thanks
    2
    Thanked 333 Times in 325 Posts
    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?
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #7
    Regular Coder
    Join Date
    Jul 2007
    Posts
    135
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •