0

I had an image upload script that worked on my little shared hosting, but just as I switched to Virt Ded, it immediately stopped working. After some research I determined the culprit to be the PHP function imagejpeg() - which was the last bit of code in the script.

It allows me to specify null as the filepath (in which case it prints it to the screen), but does not allow me to enter ANY filepath without return false.

Anybody know what is going on?

5
  • 1
    you know, i just checked that, and made sure that all my folders have full permissions...read write execute....777, right? Commented Jan 9, 2010 at 2:30
  • Is the error_reporting set to E_ALL or higher? Any error/warning/notice messages? Commented Jan 9, 2010 at 2:32
  • yes, it is at E_ALL for the moment...is there a better one to try? Commented Jan 9, 2010 at 2:33
  • however...E_ALL isn't returning any of the errors that i normally would be ale to trigger....weird Commented Jan 9, 2010 at 2:36
  • Then try error_reporting(E_ALL); ini_set('display_errors', 1); echo THISHSOULDRAISEANOTICE; imagejpeg(.... Commented Jan 9, 2010 at 2:41

1 Answer 1

1

First I would see if the PHP install contains all the libgd stuff you need for imagejpeg().

You can check like this:

$extensions = get_loaded_extensions();

if( !in_array( 'gd', $extensions ) )
{
  die "libgd is not loaded";
}

If that's good to go you can do something like:

$gd = gd_info();

while( list( $k, $v ) = each( $gd ) )
{
  echo "$k: $v";
}

Make sure you see some jpeg stuff listed, if there is none you need some dependent libraries installed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.