同一个文件,在本地测试没有问题,FTP到服务器后,无法正常显示,求助~

dogboxr 2004-11-13 03:29:56
if($_GET["a"]=="") die("0");
$shuju=split(",",$_GET["a"]);
if(count($shuju)==0) die("2");
$tukuan=300;
$tugao=150;
$jiaodu = array();
$total=0;

for ($i = 0; $i < count($shuju); $i++) {
if(!is_numeric($shuju[$i])) die("1");
$total+=$shuju[$i];
}

for ($i = 0; $i < count($shuju); $i++) {
array_push ($jiaodu, round(360*$shuju[$i]/$total));
}

$image = imagecreate($tukuan, $tugao);
$white = imagecolorallocate($image, 0xEE, 0xEE, 0xEE);
$yanse = array(
array(
imagecolorallocate($image, 0x97, 0xbd, 0x00),
imagecolorallocate($image, 0x00, 0x99, 0x00),
imagecolorallocate($image, 0xcc, 0x33, 0x00),
imagecolorallocate($image, 0xff, 0xcc, 0x00),
imagecolorallocate($image, 0x33, 0x66, 0xcc),
imagecolorallocate($image, 0x33, 0xcc, 0x33),
imagecolorallocate($image, 0xff, 0x99, 0x33),
imagecolorallocate($image, 0xcc, 0xcc, 0x99),
imagecolorallocate($image, 0x99, 0xcc, 0x66),
imagecolorallocate($image, 0x66, 0xff, 0x99)
),
array(
imagecolorallocate($image, 0x4f, 0x66, 0x00),
imagecolorallocate($image, 0x00, 0x33, 0x00),
imagecolorallocate($image, 0x48, 0x10, 0x00),
imagecolorallocate($image, 0x7d, 0x64, 0x00),
imagecolorallocate($image, 0x17, 0x30, 0x64),
imagecolorallocate($image, 0x1a, 0x6a, 0x1a),
imagecolorallocate($image, 0x97, 0x4b, 0x00),
imagecolorallocate($image, 0x78, 0x79, 0x3c),
imagecolorallocate($image, 0x55, 0x7e, 0x27),
imagecolorallocate($image, 0x00, 0x93, 0x37)
)
);

$yuanxin_x=$tukuan/2;

for ($h = $tugao/2+5; $h > $tugao/2-5; $h--) {
$kaishi=0;
$jieshu=0;
for ($i = 0; $i < count($shuju); $i++) {
$kaishi=$kaishi+0;
$jieshu=$kaishi+$jiaodu[$i];
$yanse_i=fmod($i,10);
imagefilledarc($image, $yuanxin_x, $h, $tukuan, $tugao-20, $kaishi, $jieshu, $yanse[1][$yanse_i], IMG_ARC_PIE);
$kaishi+=$jiaodu[$i];
$jieshu+=$jiaodu[$i];
}
}

for ($i = 0; $i < count($shuju); $i++) {
$kaishi=$kaishi+0;
$jieshu=$kaishi+$jiaodu[$i];
$yanse_i=fmod($i,10);
imagefilledarc($image, $yuanxin_x, $h, $tukuan, $tugao-20, $kaishi, $jieshu, $yanse[0][$yanse_i], IMG_ARC_PIE);
$kaishi+=$jiaodu[$i];
$jieshu+=$jiaodu[$i];
}

header('Content-type: image/png');
imagepng($image);
imagedestroy($image);


以上代码是为了生成一个并图用的,传入参数,?a=1,1,1,1,1,1,本应正常显示,
结果在服务器上显示,
Fatal error: Call to undefined function: imagecreate() in E:\website\Apache2\htdocs\bing_img.php on line 34

烦啊,请各位高手帮帮忙~~~
...全文
127 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
dogboxr 2004-11-19
  • 打赏
  • 举报
回复
我已经下载了一个GD2.0的 问一下 怎么安装 谢谢
dogboxr 2004-11-19
  • 打赏
  • 举报
回复
对了 可以请教 怎么安装GD库吗 在那下载呢
abaowu 2004-11-18
  • 打赏
  • 举报
回复
楼上正解,联系服务器管量员吧
xuefengal 2004-11-18
  • 打赏
  • 举报
回复
服务器上GD库没安装,或者太老
dogboxr 2004-11-18
  • 打赏
  • 举报
回复
回复人: hflsj(hflsj) ( ) 信誉:95 2004-11-13 21:13:00 得分: 0


服务器上缺少GD组件支持。 只要把php.ini 中 ";......=gd.dll" 前面的分号去掉就可以了。



朋友 帮我 好吗
dogboxr 2004-11-15
  • 打赏
  • 举报
回复
哎 还是不行 说没有找到该组件,应该在那找呢
hflsj 2004-11-13
  • 打赏
  • 举报
回复
服务器上缺少GD组件支持。 只要把php.ini 中 ";......=gd.dll" 前面的分号去掉就可以了。
dogboxr 2004-11-13
  • 打赏
  • 举报
回复
楼上的朋友 可以帮忙说清楚吗 我不太明白
blueoxygen 2004-11-13
  • 打赏
  • 举报
回复
服务器没装GD?

21,882

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧