【问题标题】:How to compile php to enable webp support?如何编译 php 以启用 webp 支持?
【发布时间】:2014-05-12 05:53:53
【问题描述】:

虽然我多次编译php 5.5.10,但仍然无法启用webp支持,这是由“http://cn2.php.net/manual/zh/function.imagewebp.php”描述的。 这是我的编译设置:

CentOS release 5.8 (Final) x86_64
freetype-2.4.6
jpeg-8c
libpng-1.2.35
gd-2.1.0

php编译命令

./configure    --prefix=/apps/lib/php-5.5.10  --with-mysql=mysqlnd   --with-mysqli=mysqlnd   --with-pdo-mysql=mysqlnd   --enable-mysqlnd   --enable-fpm   --enable-mbstring   --enable-mbregex   --with-zlib-dir=/apps/lib/zlib   --enable-pcntl   --enable-sockets   --enable-ftp   --enable-soap   --enable-bcmath   --disable-debug   --enable-sockets   --enable-inline-optimization   --disable-rpath   --with-mysql=/apps/svr/mysql5   --with-libxml-dir=/apps/lib/libxml   --with-jpeg-dir=/apps/lib/jpeg   --with-iconv-dir=/apps/lib/libiconv   --with-mcrypt=/apps/lib/libmcrypt   --with-freetype-dir=/apps/lib/freetype   --with-gd=/apps/lib/gd-2.1.0  --with-openssl-dir=/apps/lib/openssl   --with-openssl=/apps/lib/openssl   --with-curl=/apps/lib/curl  --with-png-dir=/apps/lib/libpng --enable-opcache=no

最后得到 gd 的输出

gd

GD Support => enabled
GD Version => 2.1.0-alpha
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.4.6
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 8
PNG Support => enabled
libPNG Version => 1.2.35
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled

虽然我按照“http://techglimpse.com/install-upgrade-php55-yum/”的步骤使用 remi.repo 安装 php 5.5.9,但我终于从 gd 的输出中获得了成功信号

gd

GD Support => enabled
GD Version => 2.1.0
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.2.1
T1Lib Support => enabled
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 6b
PNG Support => enabled
libPNG Version => 1.2.10
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled
WebP Support => enabled

出于系统管理员的考虑,我需要用编译版本部署php。 我在编译 php 或 lib gd 时遗漏了什么重要的东西

【问题讨论】:

  • 我认为这应该在超级用户中询问。
  • 嗨@enapupe,你能更具体一点吗? “在超级用户中被问到”我不明白。

标签: php webp


【解决方案1】:

要启用 WebP 支持,您必须将 --with-vpx-dir= 添加到您的配置行(当然还要安装 libvpx)。另见https://bugs.php.net/bug.php?id=64476

【讨论】:

猜你喜欢
  • 2019-11-22
  • 1970-01-01
  • 2021-01-01
  • 1970-01-01
  • 2012-06-23
  • 2016-11-15
  • 2021-11-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多