It fails also, Fatal error: Call to undefined function ImageCreateFromjpeg() in C:\Documents an d Settings\Administrator\Desktop\test.php on line 5 *face palms so hard it leaves a crator* Its always something obvious, in this instance the gd2 extension wasnt being loaded in the php-cli.ini file (but was loaded in php.ini). So it worked for websties (and phpinfo()) but not for command line scripts. Might be worth changing that default ini file to include things such as that extension.