tags:

views:

326

answers:

1

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?

A: 

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.

gdonald