PHP配置问题.
PHP.INI中将PHP_GD.DLL这行前面的分号去掉就可以了.

解决方案 »

  1.   

    在php.ini中:
    ;extension=php_gd.dll
    extension=php_gd2.dll
    这两行中只能去一行前面的';'.设置
    extension_dir = d:/php/extensions/ ;将路径改为你的php/extensions的路径.
    保存.
    重起pws
      

  2.   

    也可以将extension下的gd.dll php_zlib.dll zlib.dll拷贝到windows/system32目录下就可以了 然后将php.ini前面的;去掉
      

  3.   


    对,就是原来的错误,我的extension就是c:/php   php_gd.dll gd.dll和 php_zlib.dll都拷到了该目录下,然后去掉了分号。但是还是有错误。
      

  4.   

    修改c:\php下的php.ini文件.
    ;extension=php_gd.dll #不使用gd
    extension=php_gd2.dll #使用gd2extension_dir = "d:\php\extensions"
    另:
    重起pws时有无错误提示?
      

  5.   


    不管是gd还是gd2都是一样的错误,不过现在不是提示imagecreate() 错而是:
    <br />
    <b>Fatal error</b>:  Call to undefined function:  imagegif() in <b>c:\myphp\php\counter_graph.php</b> on line <b>73</b><br />
    菜单项等依然不能展开。重起pws时没有任何错误提示。
      

  6.   

    在 1.6.2 版以前的 GD library 有支持 GIF 格式的功能,但因为 GIF 格式使用的 LZW 演算法牵涉到 Unisys 的专利权,因此在 GD library 1.6.2 版之后不支持 GIF 的格式。你可以用 imagepng() 来代替imagegif();
    头信息用:Header("Content-type: image/PNG");
      

  7.   

    你可以用这个网址试试:http://fonsea.51.net/php/tree_menu.php   在我的服务器中浏览时如果点击"+"加号不能够展开菜单项. 这是代码:<?   
      /*********************************************/
      /*                                           */
      /* mytree[x][0] -> 在菜单树中的层数          */
      /* mytree[x][1] -> 菜单项的名称              */
      /* mytree[x][2] -> 菜单项连接的URL地址       */
      /* mytree[x][3] -> 连接的目标窗口            */
      /* mytree[x][4] -> 是否子树的最后一项        */
      /*********************************************/
      
      /*********************************************/
      /*                                           */
      /* 把文本文件中存储的菜单树的结构            */
      /* 放到数组$mytree中,以便在后面的程序       */
      /* 中使用,它是最重要的数据结构              */
      /*********************************************/function tree_setup()
    {
      global  $maxlevel;
      global  $mytree;
      
      $maxlevel=0;//菜单项的最大层数
      $context=0; //当前的菜单项的序号  
      
      $fd = fopen("menu.txt", "r");//打开文件
      
      if ($fd==0) 
        die("tree_menu.php : Unable to open file "."menu.txt");
        
      while ($buffer = fgets($fd, 4096)) 
      {
        $mytree[$context][0]=strspn($buffer,".");
        $tmp=rtrim(substr($buffer,$mytree[$context][0]));
        $node=explode("|",$tmp); 
        $mytree[$context][1]=$node[0];
        $mytree[$context][2]=$node[1];
        $mytree[$context][3]=$node[2];
        $mytree[$context][4]=0;    if ($mytree[$context][0] > $maxlevel) 
            $maxlevel=$mytree[$context][0];    
        $context++;
      }//context={0, 8} 
      
      fclose($fd);
    }tree_setup();for ($i=0; $i<count($mytree); $i++) //给下列数组赋初值
      {
         $expand[$i]=0;
         $visible[$i]=0;
         $levels[$i]=0;
      }
      if ($p!="") 
         $explevels = explode("|",$p);//获得需要展开的节点
      echo $explevels."<br>\n";
      $i=0;
      
      while($i<count($explevels))
      {
        $expand[$explevels[$i]]=1;
        $i++;
      }
      /*********************************************/
      /*  找到子树的最后一个节点                   */
      /*********************************************/  $lastlevel=$maxlevel;
      for ($i=count($mytree)-1; $i>=0; $i--)
      {
         if ( $mytree[$i][0] < $lastlevel )
         {
           for ($j=$mytree[$i][0]+1; $j <= $maxlevel; $j++)
           {
                 $levels[$j]=0;
           }
         }
         if ( $levels[$mytree[$i][0]]==0 )
         {
           $levels[$mytree[$i][0]]=1;
           $mytree[$i][4]=1;
         }
         else
         $mytree[$i][4]=0;
         $lastlevel=$mytree[$i][0];  
      }
      
      /*********************************************/
      /*  找到需要显示的节点                       */
      /*********************************************/
      
      $visible[0]=1;   // root is always visible
      for ($i=0; $i<count($explevels); $i++)
      {
        $n=$explevels[$i];
        if ( ($visible[$n]==1) && ($expand[$n]==1) )
        {
           $j=$n+1;
           while ( $mytree[$j][0] > $mytree[$n][0] )
           {
             if ($mytree[$j][0]==$mytree[$n][0]+1) $visible[$j]=1;     
             $j++;
           }
        }
      }
      /*********************************************/
      /*  菜单树的输出程序                         */
      /*  它不仅输出要显示的菜单项                 */
      /*  而且需要改变浏览器的URL地址              */
      /*********************************************/
      
      for ($i=0; $i<$maxlevel; $i++) $levels[$i]=1;  $maxlevel++;
      
      echo "<table cellspacing=0 cellpadding=0 border=0 ";
      echo "cols=".($maxlevel+3)." width=".($maxlevel*16+100).">\n";
      echo "<tr>";
      for ($i=0; $i<$maxlevel; $i++) echo "<td width=16></td>";
      echo "<td width=100></td></tr>\n";
      $context=0;
      while ($context<count($mytree))
      {
        if ($visible[$context])
        {
          /****************************************/
          /* 开始一个新行                         */
          /****************************************/      
          echo "<tr>";
          
          /****************************************/
          /* 显示树型结构的垂直直线               */
          /****************************************/
          $i=0;
          while ($i<$mytree[$context][0]-1) 
          {
            if ($levels[$i]==1)
                echo "<td><img src=\""."images\\tree_vertline.gif"."\"></td>";
            else
                echo "<td><img src=\""."images\\tree_space.gif"."\"></td>";
            $i++;
          }
          
          /****************************************/
          /* 在子树的最后需要显示另外的图片       */
          /****************************************/         
          if ($mytree[$context][4]==1) 
          {
            echo "<td><img src=\""."images\\tree_end.gif"."\"></td>";
            $levels[$mytree[$context][0]-1]=0;
          }
          else
          {
            echo "<td><img src=\""."images\\tree_split.gif"."\"></td>";                  
            $levels[$mytree[$context][0]-1]=1;    
          }       if ($mytree[$context+1][0]>$mytree[$context][0])
          /****************************************/
          /*条件成立,则说明是一般的节点          */
          /*条件不成立,则说明是叶节点            */
          /****************************************/         
          {
            $i=0; $params="?p=";
            while($i<count($expand))
            {
              if (($expand[$i]==1)&&($context!=$i)||($expand[$i]==0&&$context==$i))
              {
                $params=$params.$i;
                $params=$params."|";
              }
              $i++;
            }
                   
            if ($expand[$context]==0)
               {
                 echo "<td><a href=\"".$SCRIPT_NAME.$params."\"><img src=\"";
                 echo "images\\tree_expand.gif"."\" border=no></a></td>";
               }
            else
                {
                echo "<td><a href=\"".$SCRIPT_NAME.$params."\"><img src=\"";
                echo "images\\tree_collapse.gif"."\" border=no></a></td>";
                }         
          }
          else
          //叶节点
          {
            echo "<td><img src=\""."images\\tree_leaf.gif"."\"></td>";         
          }
          
          /****************************************/
          /*条件成立,则说明要建立超连接          */
          /*条件不成立,则不用建立超链接          */
          /****************************************/         
          if ($mytree[$context][2]=="")
              {
              echo "<td colspan=".($maxlevel-$mytree[$context][0]);
              echo ">".$mytree[$context][1]."</td>";
              }
          else
              {
              echo "<td colspan=".($maxlevel-$mytree[$context][0]);
              echo "><a href=\"".$mytree[$context][2]."\" target=\"";
              echo $mytree[$context][3]."\">".$mytree[$context][1]."</a></td>";
              }    }
        $context++;    
      }
      //菜单项建立完毕
      echo "</table>\n";                
     ?>Menu.text为:
    .<b>海上飞翔</b>
    ..<b>服务台</b>
    ...首页|index.php|_top
    ...逆向英语|survey.php|mymain
    ...vc编程|rili.php|mymain
    ...海上新闻|news.php|mymain
    ...海上论坛|ourforum.php|mymain
    ...聊天室|bbsindex.php|main
    ...关于本站|maillist.php|main
    ...友情连接|friends.php|mymain
      

  8.   

    还有这段代码我也有些地方没搞懂~~~~我也是刚刚开始学php的