图形函数出错.
我的源码:<html>
<head>
<title>生成一幅图形</title>
<meta content="">
<style></style>
</head>
<body>
<?php
//send the header to browse to prepare for recieving
Header("Content-type:image/png");
//create an image
$im=imagecreate(400,300);
//set color black and white:
$black=ImageColorAllocate($im,0,0,0);
$white=ImageColorAllocate($im,255,255,255);
//draw aline
imageline($im,1,1,350,25,$black);
//draw an arc
imagearc($im,200,15,20,20,35,190,$white);
//output a string
imagestring($im,5,4,10,"My First Image Test!!",$white);
//crate png image
ImagePng($im);
//destroy the image:
ImageDestroy($im);
?>
</body>
</html>
------------------------------------------------------------------------------------------------
错误提示:
Warning: Cannot add header information - headers already sent by (output started at /var/www/html/fish/图形函数/ima.php:5) in /var/www/html/fish/图形函数/ima.php on line 10
塒NG
----------------------------------------------------------------------------------------------
我的那本教程书上说:
"上面那个图像函数需要在编译PHP前先安装GD library.同时在编译PHP的时候在配置时需要加入--whith-gd"
我是否需要重新编译?
我现在用的这个PHP+MYSQL是redhat9.0自带的.
如果真的要重新编译的话,是否是下载一个PHP的源码安装编译就行?
还有,RH9系统自带的PHP+MYSQL是否有包括上面所说的GD library???
谢谢~~~~~~~~~~~~~~~~ 在
Header("Content-type:image/png");
之前不能有任何的输出。(包括回车)
把
<html>
<head>
<title>生成一幅图形</title>
<meta content="">
<style></style>
</head>
<body>
以及
</body>
</html>
删掉~~ Thank you ***9999999!!!!
搞定~~~
页:
[1]