Red Hat Bugzilla – Bug 152171
imagejpeg() function is not supported
Last modified: 2007-11-30 17:11:02 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Description of problem:
A call to imagejpeg funvtion in php code returns this error message:
"Call to undefined function imagejpeg() in [...]"
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. see above
Expected Results: calling imagejpeg($imageResource) should output the image to the borwser window.
I have installed all the packages required to support jpeg files:
rpm -ql libjpeg.x86_64 gives:
phpinfo() returns that php was compiled using --with-jpeg-dir=/usr
Can you attach the complete phpinfo() output?
The link to my phpinfo:
Link to the page where imagejpeg() is used:
When you click on one of the thumbnails it should display full-size image but
instead it throws an error that jpeg image contains errors and cannot be
displayed. Viewing the source code of the page with the error will reveal the
error message from php which states that imagejpeg function is uundefined. the
code that is used to display fullsize image looks likt this:
$exif = read_exif_data($jpgFile, 0, true);
$orientation = $exif["IFD0"]["Orientation"];
$image = imagecreatefromjpeg($jpgFile);
if( $orientation == 8 )
$image = imagerotate($image, 90, 0);
There is no gd section in there, have you disabled gd support?
Whoops, my server is currently down due to gdm update crash :-(. Therefore I
cannot post my gd.ini right now. However I didn't enable/disable anything
manually - all config files come from the stock installation of FC3 that was
updgraded to FC4 Test 1. I'll bring my server back up when I get home from work
at around 6:00pm EST and post my config files.
Created attachment 112438 [details]
Created attachment 112439 [details]
Ok, I'm back online, so I have attached my gd.ini from /etc/php.d/ and php.ini
from /etc. Those files look fine for me, so below are rpm queries with gd
[maners@athlon64 ~]$ rpm -q gd
[maners@athlon64 ~]$ rpm -ql gd
[maners@athlon64 ~]# rpm -ql php-gd
Also the link I posted with the example of imagejpeg use should be like the
It still looks to me like you don't have the gd extension enabled for whatever
reason. What's the complete output of "php -m"?
Well, it seems to be enabed at least in theory :-)
[maners@athlon64 ~]$ php -m
Can you show the output via Apache of a page which just has:
and also attach /var/log/httpd/error_log.
Created attachment 112454 [details]
GD is not here:
Ok, the problem is solved. I looked into the error_log file and it came out that
my php.ini in /etc had extension_dir=/usr/lib/php4 instead of
Thank you for your help.
Yup, well spotted. I've changed the package so that on this upgrade, the old
php.ini will be replaced by the new, correct php.ini by default.