Home > php教程 > php手册 > php开启GD库实现方法

php开启GD库实现方法

WBOY
Release: 2016-06-13 10:10:55
Original
3668 people have browsed it

GD库在php中默认是没有开启的,如果想让它支持图片处理功能我们需要在php.ini中把extension=php_gd2.dll 去掉前面的;就行了就行了。

在windows服务器开启php的gd库时,使用cgi之后phpinfo()得到的结果中 Configure Command 中并没有出现gd.

将php.ini文件找到extension=php_gd2.dll  去掉前面的;就行了。

另外附上如何检测是否已经安装好GD库代码!

 代码如下 复制代码

if(extension_loaded('gd')) {
  echo '你可以使用gd
';
  foreach(gd_info() as $cate=>$value)
    echo "$cate: $value
";
}else
  echo '你没有安装gd扩展';
?>

结果显示为:你可以使用gd
GD Version: bundled (2.0.34 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support: 1
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XPM Support:
XBM Support: 1
JIS-mapped Japanese Font Support:


如果有问题,

Configure Command 后显示的是:

1 cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:php-sdkoracleinstantclient10sdk,shared" "--with-oci8=C:php-sdkoracleinstantclient10sdk,shared" "--with-oci8-11g=C:php-sdkoracleinstantclient11sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo"

可能的原因:

1.权限问题;

2.双通道是否存在问题,或者是硬件是否松动

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template