各位大虾,急救! 你没有配置好gd库,建议去google搜一下或到faq找一下相关文章 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 能接触到服务器上的PHP.INI吗?把extension=php_gd.dll前的分号去掉。 不是不是很蝗白,怎么看能不能接触到服务器的PHP.INI啊 这该怎么说?我原来也碰见过这情况,配置PHP不是要配PHP.INI吗,我的意思是说你要改那个文件,前面还有一个好象是extension_dir要加上php_gd.dll所在的目录路径。 GD没配置好,先把PHP.INI中得extension=php_gd.dll前面得分号去掉试试 程序是这样的<?php$picwidth=360*2;$pichight=200;$pic=ImageCreate($picwidth+1,$picheight+1);$cwhite=ImageColorAllocate($pic,255,255,255);ImageFilledRectangle($pic,0,0,$picwidth+1,$picheight+1,$cwhite);$cred=ImageColorAllocate($pic,255,0,0);$cblue=ImageColorAllocate($pic,0,255,0);$curx=0;$cury=$picheight;for($pt=0; $pt<$picwidth; $pt++) {$newx=$curx+1;$newy=($picheight/2)+(cos(deg2rad($newx))*($picheight/2));ImageLine($pic,$curx,$cury,$newx,$newy,$cred);$curx=$newx;$cury=$newy;}$curx=0;$cury=$picheight/2;for($pt=0; $pt<$picwidth; $pt++) { $newx=$curx+1; $newy=($picheight/2)+(sin(deg2rad($newx))*($picheight/2)); ImageLine($pic,$curx,$cury,$newx,$newy,$cblue); $curx=$newx; $cury=$newy;}$cblack=ImageColorAllocate($pic,0,0,0);ImageLine($pic,0,0,0,$picheight,$cblack);ImageLine($pic,0,$picheight/2,$picwidth,$picheight/2,$cblack);ImagePNG($pic,"./pngs/graph.png");ImageDestroy($pic);?> 在PHP.INI中没找到extension=php_gd.dll?把它前面的分号去掉。然后要在extension_dir = 后加上文件php_gd.dll所在的目录路径。 PHP写的server端,如何接收手机客户端传来的json数据 读取数据库关于mysql_db_query,关于字符集的问题 //各位,请帮忙解决php中"::"用域分辨运算符的小问题,试了一天都不成功! 请教:如何保持持久连接。 要把一个数据库里的某几张表的结构和数据提取成.sql要怎么写 数据更新 请问PHP团队协作的时候,是怎样进行版本控制的? 使用PHP5遇到的怪事 有什么办法在显示图片时给图片加水印又不会影响速度和生成大量的临时文件吗? 路径问题:请看下面代吗? 写文本文件时怎么样实现换行(最后十分) 不知道这个算不算PHP的BUG
$picwidth=360*2;
$pichight=200;
$pic=ImageCreate($picwidth+1,$picheight+1);
$cwhite=ImageColorAllocate($pic,255,255,255);
ImageFilledRectangle($pic,0,0,$picwidth+1,$picheight+1,$cwhite);
$cred=ImageColorAllocate($pic,255,0,0);
$cblue=ImageColorAllocate($pic,0,255,0);
$curx=0;
$cury=$picheight;
for($pt=0; $pt<$picwidth; $pt++) {
$newx=$curx+1;
$newy=($picheight/2)+(cos(deg2rad($newx))*($picheight/2));
ImageLine($pic,$curx,$cury,$newx,$newy,$cred);
$curx=$newx;
$cury=$newy;
}
$curx=0;
$cury=$picheight/2;
for($pt=0; $pt<$picwidth; $pt++) {
$newx=$curx+1;
$newy=($picheight/2)+(sin(deg2rad($newx))*($picheight/2));
ImageLine($pic,$curx,$cury,$newx,$newy,$cblue);
$curx=$newx;
$cury=$newy;
}
$cblack=ImageColorAllocate($pic,0,0,0);
ImageLine($pic,0,0,0,$picheight,$cblack);
ImageLine($pic,0,$picheight/2,$picwidth,$picheight/2,$cblack);
ImagePNG($pic,"./pngs/graph.png");
ImageDestroy($pic);
?>