安装PHP提示 No package 'libwebp' found 的解决方法

涂红伟, 2023年01月08日 22:21:18

因为测试程序的需求,需要将一台阿里云香港服务器由PHP8.0换成PHP8.1版本,服务器系统为Debian11,在安装PHP8.1过程出现错误提示 No package 'libwebp' found 安装失败,详细提示如下:

Configuring extensions
checking for io.h... no
checking for strtoll... yes
checking for atoll... yes
checking whether to build with LIBXML support... yes
checking for libxml-2.0 >= 2.9.0... yes
checking for OpenSSL support... yes
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for openssl >= 1.0.2... yes
checking for RAND_egd... no
checking for PCRE library to use... bundled
checking whether to enable PCRE JIT functionality... yes
checking whether Intel CET is enabled... no
checking whether to enable the SQLite3 extension... yes
checking for sqlite3 >= 3.7.7... yes
checking for sqlite3_errstr in -lsqlite3... yes
checking for sqlite3_expanded_sql in -lsqlite3... yes
checking for sqlite3_load_extension in -lsqlite3... yes
checking for ZLIB support... yes
checking for zlib >= 1.2.0.4... yes
checking whether to enable bc style precision math functions... yes
checking for BZip2 support... no
checking whether to enable calendar conversion support... no
checking whether to enable ctype functions... yes
checking for cURL support... yes
checking for libcurl >= 7.29.0... yes
checking for SSL support in libcurl... yes
checking for libcurl linked against old openssl... no
checking for curl_easy_perform in -lcurl... yes
checking for QDBM support... no
checking for GDBM support... no
checking for NDBM support... no
checking for TCADB support... no
checking for LMDB support... no
checking for Berkeley DB4 support... no
checking for Berkeley DB3 support... no
checking for Berkeley DB2 support... no
checking for DB1 support... no
checking for DBM support... no
checking for CDB support... no
checking for INI File support... no
checking for FlatFile support... no
checking whether to enable DBA interface... no
checking whether to enable dl-test extension... no
checking whether to enable DOM support... yes
checking for libxml-2.0 >= 2.9.0... yes
checking whether to build with Enchant support... no
checking whether to enable EXIF (metadata from images) support... yes
checking for FFI support... no
checking for fileinfo support... no
checking whether to enable input filter support... yes
checking whether to enable FTP support... yes
checking whether to explicitly enable FTP SSL support... no
checking for openssl >= 1.0.2... yes
checking for GD support... yes
checking for external libgd... no
checking for libavif... no
checking for libwebp... yes
checking for libjpeg... yes
checking for libXpm... no
checking for FreeType 2... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
checking for zlib... yes
checking for libpng... yes
checking for libwebp >= 0.2.0... no
configure: error: Package requirements (libwebp >= 0.2.0) were not met:

No package 'libwebp' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables WEBP_CFLAGS
and WEBP_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target 'install'.  Stop.
PHP install failed, Please Contact the author!
Killed
Image
安装PHP提示 No package 'libwebp' found 的解决方法

从提示可以判断出是由于缺少了libwep安装包导致的,需要先手动安装好libwebp才能继续安装PHP8.1,通过搜索找到解决方法。

Debian/Ubuntu系统

登录root,依次执行下面的命令:

1、更新安装源

apt-get update

2、安装libwebp及依赖

apt-get install libwebp-dev

Redhat/Centos7版本系列系统:

1、下载libwebp安装依赖包

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libwebp-0.3.0-7.el7.i686.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libwebp-devel-0.3.0-7.el7.x86_64.rpm

2、安装libwebp及依赖包

rpm -ivh libwebp*

Redhat/Centos8版本系列系统:

1、下载libwebp安装依赖包

wget https://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/libwebp-1.0.0-5.el8.x86_64.rpm
wget https://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/libwebp-devel-1.0.0-5.el8.i686.rpm

2、安装libwebp及依赖包

rpm -ivh libwebp* 

安装好libwebp再安装PHP8.1就没有问题了。

如果安装过程提示 PHP8.1configure: error: iconv does not support errno 可以参照《PHP8.1安装报错configure: error: iconv does not support errno的解决方法

标签