[PHP-users 7589] imagejpeg() 、 imagepng()で Call to undefined function エラー

NetCool! php-users@php.gr.jp
Mon, 20 May 2002 12:31:31 +0900


服部です。

環境
-------------
os:linux
php-4.2.1
gd-1.8.4
freetype-1.3.1
jpeg-6b
libpng-1.0.13
zlib-1.1.4
--------------

以下のソースを実行しようとすると
Call to undefined function エラーがでてしまいます。
php4 コンパイルで gd、png、jpeg を指定していますし、
phpinfo.php の gd の情報もOKみたいなのですが
imagejpeg($im); の部分でエラーになるみたいです。
imagejpeg() を使うには コンパイル、インストール以外
に他に設定がいるのでしょうか?なにかincludeとかしないと
いけないのでしょうか。
よろしくお願いします。


■ graphic01.php ソース
-----------------------------------
<?php
header("Content-type: image/jpeg");
$im = imagecreate(100,100);
imagejpeg($im);
imagedestroy($im);
?>
-----------------------------------


■ エラー内容
-----------------------------------------------------
X-Powered-By: PHP/4.2.1
Content-type: image/jpeg

Fatal error :  Call to undefined function:  imagejpeg() in
/php/graphic01.php line 4
-----------------------------------------------------


■ php4 のコンパイル
-----------------------------------------------------
./configure  --with-pgsql
             --with-gd 
             --with-jpeg-dir=/home/hattori/jpeg-6b/
             --with-png-dir=/home/hattori/libpng-1.0.13/
             --with-zlib-dir=/home/hattori/zlib-1.1.4/
-----------------------------------------------------


■ phpinfo.php の gd の情報
-----------------------------------------------------
GD Support enabled 
GD Version 1.6.2 or higher 
WBMP Support enabled 
-----------------------------------------------------