Page 1 of 1

error "Call to undefined function"

Posted: Fri Mar 20, 2009 5:51 am
by FireLord
Hi guys, i've a problem with php 4.0.3.
On this code:

Code: Select all

$im = imagecreatefromjpeg("images/banners/shop-ad.jpg");
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
$text = 'Testing...';
$font = 'arial.ttf';
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
I've this error:
Fatal error: Call to undefined function: imagecreatefromjpeg()
at the line "$im = imagecreatefromjpeg("images/banners/shop-ad.jpg");"


In my php.ini exists "extension=php_gd2.dll" without ";" before.

Can anyone help me pliiz?

Re: error "Call to undefined function"

Posted: Fri Mar 20, 2009 6:28 am
by Benjamin
Did you see this?
http://us.php.net/manual/en/function.im ... .php#75184

Also, in case you have more than 1 php.ini, be sure you are editing the correct one. You can verify the path of your ini file by running phpinfo();.

The manual also says:
The Manual wrote: Note: JPEG support is only available if PHP was compiled against GD-1.8 or later.