<?PHP
header("Content-type: image/gif");
$image=imagecreate(200,200);
$maroon=imagecolorallocate($image,100,0,0);
$white=imagecolorallocate($image,255,255,255);
imagefilledrectangle($image,0,0,200,200,$white);
imagerectangle($image,10,10,190,190,$maroon);
imagefilledrectangle($image,50,50,150,150,$maroon);
imagegif($image);
imagedestroy($image); ?>
这是我在网上找的一个关于php画图的例子,当我测试服务器用的是本地的时候可以正常显示图片如下:站点的测试服务器如下:
但是当我测试服务器改为远程的时候就出现了下面的问题:
<br />
<b>Fatal error</b>: Call to undefined function imagecreate() in <b>/usr/local/apache2/htdocs/gift/menu.php</b> on line <b>3</b><br />
下面是测试服务器的远程定义:请问这是什么原因啊?
说明:我将php.ini文件里的;extension=php_gd2.dll前的分号去了的。
header("Content-type: image/gif");
$image=imagecreate(200,200);
$maroon=imagecolorallocate($image,100,0,0);
$white=imagecolorallocate($image,255,255,255);
imagefilledrectangle($image,0,0,200,200,$white);
imagerectangle($image,10,10,190,190,$maroon);
imagefilledrectangle($image,50,50,150,150,$maroon);
imagegif($image);
imagedestroy($image); ?>
这是我在网上找的一个关于php画图的例子,当我测试服务器用的是本地的时候可以正常显示图片如下:站点的测试服务器如下:
但是当我测试服务器改为远程的时候就出现了下面的问题:
<br />
<b>Fatal error</b>: Call to undefined function imagecreate() in <b>/usr/local/apache2/htdocs/gift/menu.php</b> on line <b>3</b><br />
下面是测试服务器的远程定义:请问这是什么原因啊?
说明:我将php.ini文件里的;extension=php_gd2.dll前的分号去了的。
linux下可能要重新编译,ubuntu下,只需要
sudo apt-get install php_gd