php编译gd支持gif,PHP GD Library中没有PNG支持,但支持GIF和JPEG.我怎样才能解决这个问题?...

我在OS X Yosemite上运行MAMP服务器版本3.0.5.在执行期间,我的php文件似乎缺少PNG支持

甚至在我使用MAMP 2.1之前,它在png相关功能上都有致命的错误.

Jpeg函数工作正常.

这就是我的phpinfo的样子:

Build Date Apr 10 2014 17:21:18

Configure Command './configure' '--with-mysql=/Applications/MAMP/Library' '--with-apxs2=/Applications/MAMP/Library/bin/apxs' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-zlib-dir=/Applications/MAMP/Library' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php/php5.5.10' '--exec-prefix=/Applications/MAMP/bin/php/php5.5.10' '--sysconfdir=/Applications/MAMP/bin/php/php5.5.10/conf' '--with-config-file-path=/Applications/MAMP/bin/php/php5.5.10/conf' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/usr' '--with-ldap' '--with-mysqli=/Applications/MAMP/Library/bin/mysql_config' '--with-t1lib=/Applications/MAMP/Library' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007f' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=shared,/Applications/MAMP/Library' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl' '--enable-zip' '--with-iconv=/Applications/MAMP/Library' '--enable-opcache' '--enable-intl' '--with-tidy=shared' '--with-icu-dir=/Applications/MAMP/Library'

这就是GD部分包含的内容:

GD Support enabled

GD Version bundled (2.1.0 compatible)

FreeType Support enabled

FreeType Linkage with freetype

FreeType Version 2.4.12

T1Lib Support enabled

GIF Read Support enabled

GIF Create Support enabled

JPEG Support enabled

libJPEG Version 8

PNG Support enabled

libPNG Version 1.6.6

WBMP Support enabled

XBM Support enabled

要测试代码中存在的png执行和gd库,我运行以下代码:

if (extension_loaded('gd')) {

echo "\nGD support is -Loaded-";

}else{

echo "\nGD support is == NOT == loaded ";

}

if(function_exists('gd_info')){

echo "\nGD function support is -Available- ";

}else{

echo "\nGD function support is == NOT == available ";

}

if(function_exists('imagepng')){

echo "\nimagepng() -Exists-";

}else{

echo "\nimagepng() ==== DOES NOT ==== Exist";

}

if(function_exists('imagejpeg')){

echo "\nimagejpeg() -Exists-";

}else{

echo "\nImage Function ==== DOES NOT ==== Exists";

}

这是我得到的结果:

我注意到的一件事是GD中的libPNG版本是’1.6.6′,而我计算机上的libPNG版本是’1.6.12′.是否有可能导致PNG功能出现问题?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值