您的位置:首页 > 其它

如何使GD支持webpq

2016-05-10 15:58 190 查看
因为项目原因,需要支持webp格式,扒文无数,终于解决。

我的环境如下:CentOS6.4/PHP5.6.16。

1、编译安装libvpx(https://github.com/webmproject/libvpx/releases)。我用的是1.5的,假设安装到/usr/local/lib下

2、编译安装libwebp(https://github.com/webmproject/libwebp/releases)。我用的是0.5的。其实这个我记不太清楚是不是必装的了--_--

3、下载个php5.6.16的源码包,其他编译参数就不提了,但是一定要加上--with-vpx-dir=/usr/local/lib(libvpx目录)。

就是这么简单,不过我也是扒文无数才找到的。。。经过漫长的编译,再来个phpinfo()。有没有发现gd下面有个
WebP Supportenabled
参阅:https://bugs.php.net/bug.php?id=67999:

It's not clear to me whether this report is Windows specific. If
so, latest PHP 5.6.x does have support for WebP enabled.
Otherwise, when compiling from the sources on other OS the
--with-vpx-dir= option has to be passed to configure.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: