我这几天正在学PHP,也遇到很多问题,如email()函数出现不能connect的错误,imagegif()、imagecreatefromgif()未定义的错误,但imagecreate()可用。不过我是用的Windows下的Apache和PHP3。

解决方案 »

  1.   

    我估计是你没装一些动态链接库的原因,比如imagegif()就需要zlib.dll的支持,
    你去下载你所需的dll,然后在你的配置文件中作相应的改动,即可。你试试看。
      

  2.   

    另外,email()只能在unix下用
      

  3.   

    我也有同样的问题,我发现即使extension里加了php3_zlib.dll,imagegif()、imagecreatefromgif()也会没定义,但是其他的图象函数都可用。
      

  4.   

    这是错误信息:Warning: Cannot add header information - headers already sent by (output started at C:\Program Files\php-web\test.php:2) in C:\Program Files\php-web\test.php on line 3Fatal error: Call to undefined function: imagecreate() in C:\Program Files\php-web\test.php on line 4
    源程序:test.php
    <?php
    Header("Content-type: image/gif");
    $im = imagecreate(400,30);
    $black = ImageColorAllocate($im, 0,0,0);
    $white = ImageColorAllocate($im, 255,255,255);
    imageline($im, 1, 1, 350, 25, $black);
    imagearc($im, 200, 15, 20, 20, 35, 190, $white);
    imagestring($im, 5, 4, 10, "Graph TEST!!", $white);
    ImageGif($im);
    ImageDestroy($im);
    ?>
      

  5.   

    The Header() function must be the first function to print any output of any kind. 
    The error says that the error occurs at line 3, which should be your header line, but that is line 2 in the script. Do you have any html text before the script? 
    If you plan to use this function to include an image in your html, you can forget it, because you can only make an image if you use the header() statement, and you can only use the header statement if you don't print anything before the header statement. 
    Ergo, you can't print the "<img src=" tag before printing the image. 
    You will have to make a seperate script for the image.
      

  6.   

    要gd.dll才能支持image类函数。仔细看php的说明书吧。(有中文的)
    www.phpuser.com有下.
      

  7.   

    你用的是PHP4吧!
    在 PHP.ini文件中有:
    ;Windows Extensions
    ;extension=php_nsmail.dll
    extension=php_calendar.dll
    ;extension=php_dbase.dll
    ;extension=php_filepro.dll
    ;extension=php_gd.dll
    ;extension=php_dbm.dll
    ;extension=php_mssql.dll
    ;extension=php_zlib.dll
    ;extension=php_filepro.dll
    extension=php_imap.dll
    extension=php_ldap.dll
    ;extension=php_crypt.dll
    ;extension=php_msql2.dll
    ;extension=php_odbc.dll
    ; Note that MySQL support is now built in, so no dll is needed for it.
    将对应项的";"去掉,将PHP文件包里的相应文件考到Windows/system下,最重要的是指定路径正确。