prom3th3an Posted November 20, 2010 Report Share Posted November 20, 2010 Im running the latest version of Uniform Server. It has the GD2 extension installed and enabled. I used to run XAMPP but was tired of the lack of updates. I have a script that does some image editing based on the GD2 extension that will not work with Uniform Server, but works perfectly fine on XAMPP. Having read around about this issue, it seems to be commonly due to the directives being out of order when PHP was compiled however theres probably other things at play. The error I recieve when I try to run the script is "Fatal error: Call to undefined function imagecreatefromjpeg()" - imagecreatefromjpeg() is part of the GD2 php extension Can you guys please look into this? Ive pasted the GD part of my PHP info. gd GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.3.9 GIF Read Support enabled GIF Create Support enabled JPEG Support enabled libJPEG Version 6b PNG Support enabled libPNG Version 1.2.44 WBMP Support enabled XBM Support enabled Directive Local Value Master Value gd.jpeg_ignore_warning 0 0 Quote Link to comment Share on other sites More sharing options...
Ric Posted November 20, 2010 Report Share Posted November 20, 2010 I ran the following code with no errors:<?php header ("Content-type: image/jpeg"); $string = "ABC123465DEF"; $font = 5; $im = ImageCreateFromjpeg("images/logo.jpg"); $x = 5; $y = 5; $background_color = imagecolorallocate ($im, 255, 255, 255); $text_color = imagecolorallocate ($im, 255, 255,0); imagestring ($im, $font, $x, $y, $string, $text_color); imagejpeg ($im); ?> Ran on a default installation of Nano_5_6_15 Can you supply a small code snippet that fails? Or try the above to see I it fails on your machine. All the bestRic Quote Link to comment Share on other sites More sharing options...
prom3th3an Posted November 20, 2010 Author Report Share Posted November 20, 2010 Or try the above to see I it fails on your machine. It fails also, Fatal error: Call to undefined function ImageCreateFromjpeg() in C:\Documents and Settings\Administrator\Desktop\test.php on line 5 It fails also, Fatal error: Call to undefined function ImageCreateFromjpeg() in C:\Documents and 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. Quote Link to comment Share on other sites More sharing options...
Shyokou Ouyou Posted November 22, 2010 Report Share Posted November 22, 2010 Interesting, indeed ... But if you find yourself something to do with php-cli.ini, you may customize to your own needs without "changing that default ini file", e.g., with switch '-c', '-d', et cetera ... It fails also, Fatal error: Call to undefined function ImageCreateFromjpeg() in C:\Documents and 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.