Home > Backend Development > PHP Tutorial > 获取不到GD库信息呢

获取不到GD库信息呢

WBOY
Release: 2016-06-23 14:00:26
Original
867 people have browsed it

<html>	<head>		<meta http-equiv="conten-type" content="text/html; charset=utf-8">		<title>第一个PHP程序(获取服务器信息)</title>	</head>	<body>		<?php			$sysos = $_SERVER["SERVER_SOFTWARE"];			$sysversion = PHP_VERSION;						//以下两条代码连接MySQL数据库并获取MySQL数据库版本信息			mysql_connect("localhost","root","kxteb0cc");			$mysqlinfo = mysql_get_server_info();						//从服务器中获取GD库的信息			if(function_exists("gd_info")){				$gd = gd_info();				$gdinfo = $gd['GD version'];			}else {				$gdinfo = "未知";			}						//从GD库中查看是否支持FreeType字体			$freetype = $gd["FreeType Support"] ? "支持" : "不支持";						//从PHP配置文件中获得是否可以远程文件获取			$allowurl = ini_get("allow_url_fopen") ? "支持" : "不支持";						//从PHP配置文件中获得最大上传限制			$max_upload = ini_get("file_uploads") ? ini_get("upload_max_filesize") : "Disabled";						//从PHP配置文件中获得脚本的最大执行时间			$max_ex_time = ini_get("max_execution_time")."秒";						//以下两条获取服务器时间,中国大陆采用的是东八区的时间,设置时间写成Etc/GMT-8			date_default_timezone_set("ETC/GMT-8");			$systemtime = date("Y-m-d H:i:s",time());						/*  **********************************************************  */			/*  以html表格的形式将以上获取到得服务器信息输出给客户端浏览器  */			/*  **********************************************************  */			echo "<table align=center cellspacing=0 cellpadding=0>";			echo "<caption> <h2>  系统信息  </h2></caption>";			echo "<tr> <td>  Web服务器:    </td> <td> $sysos        </td> </tr>";			echo "<tr> <td>  PHP版本:      </td> <td> $sysversion   </td> </tr>";			echo "<tr> <td>  MySQL版本:    </td> <td> $mysqlinfo    </td> </tr>";			echo "<tr> <td>  GD库版本:     </td> <td> $gdinfo       </td> </tr>";			echo "<tr> <td>  FreeType       </td> <td> $freetype     </td> </tr>";			echo "<tr> <td>  远程文件获取: </td> <td> $allowurl     </td> </tr>";			echo "<tr> <td>  最大上传限制: </td> <td> $max_upload   </td> </tr>";			echo "<tr> <td>  最大执行时间: </td> <td> $max_ex_time  </td> </tr>";			echo "<tr> <td>  服务器时间:     </td> <td> $systemtime </td> </tr>";			echo "</table>";		?>	</body></html>
Copy after login

请帮我看看哪错了,照着书打的,其他都没问题,就GD库版本获取不到,该行网页显示为空


回复讨论(解决方案)

$gdinfo = $gd['GD Version'];

$gdinfo = $gd['GD Version'];
一样啊?没看出问题

$gdinfo = $gd['GD Version'];
额,大写V,不好意思,结贴明明给了分的,提交后不知怎么没给到

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template