京东自营 + 国补 iPhone 历史最低价          国家补贴 享8折

CentOS 安装编译错误/缺失依赖库汇总,解决方法和安装命令集合

本文提供了在CentOS上编译PHP时遇到的多种常见错误及其详细解决方案,包括缺失依赖库、配置文件问题等,帮助开发者快速定位并解决编译过程中的各种难题。
ERROR: the HTTP XSLT module requires the libxml2/libxslt

yum -y install libxml2 libxml2-dev
yum -y install libxslt-devel


ERROR: the HTTP image filter module requires the GD library.

yum -y install gd-devel


ERROR: the GeoIP module requires the GeoIP library.

yum -y install GeoIP GeoIP-devel GeoIP-data


ERROR: the Google perftools module requires the Google perftools

yum -y install gperftools


ERROR: libatomic_ops library was not found.

yum -y install libuuid-devel libblkid-devel libudev-devel fuse-devel libedit-devel libatomic_ops-devel


ERROR trying to exec 'cc1plus': execvp: No such file or directory

yum -y install gcc-c++



ERROR: [pool www] cannot get uid for user 'www-data'

groupadd www-data
useradd -g www-data www-data


configure: ERROR: mbed TLS libraries not found.

需要安装mbedtls
#1、下载并解压
wget https://tls.mbed.org/download/mbedtls-2.16.3-gpl.tgz
tar -xf mbedtls-2.16.3-gpl.tgz
cd mbedtls-2.16.3

#2、编译安装
make
make DESTDIR=/usr install
ldconfig

#如果出现 make[1]: python2: Command not found 错误,执行:
yum -y install python2

#如果出现 /usr/bin/env: ‘perl’: No such file or directory 错误,执行:
yum -y install perl


ERROR: Cannot find OpenSSL's <evp.h>

yum install openssl openssl-devel
ln -s /usr/lib64/libssl.so /usr/lib/


ERROR: Libtool library used but 'LIBTOOL' is undefined

yum install libtool


exec: g++: not found

yum -y update gcc
yum -y install gcc+ gcc-c++


configure: ERROR: tss lib not found: libtspi.so

yum install trousers-devel


Can't exec "autopoint": No such file or directory

yum install gettext gettext-devel gettext-common-devel


configure: ERROR: libcrypto not found.

yum remove openssl-devel
yum -y install openssl-devel


configure: ERROR: Package requirements (libffi >= 3.0.0) were not met: No package 'libffi' found

yum install libffi-devel


fatal ERROR: uuid.h: No such file or directory

yum install e2fsprogs-devel uuid-devel libuuid-devel


configure: ERROR: openssl lib not found: libcrypto.so

yum install openssl-devel


tar (child): lbzip2: Cannot exec: No such file or directory

yum -y install bzip2


configure: ERROR: C++ preprocessor "/lib/cpp" fails sanity check

yum install gcc-c++


configure: ERROR: Please reinstall the BZip2 distribution

yum install bzip2 bzip2-devel


configure: ERROR: cURL version 7.15.5 or later is required to compile php with cURL support

yum install curl-devel


configure: ERROR: not found. Please provide a path to MagickWand-config or Wand-config program

yum install ImageMagick-devel



configure: ERROR: no acceptable C compiler found in $PATH

yum install gcc


configure: ERROR: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met:

yum install libicu-devel


configure: ERROR: Package requirements (sqlite3 > 3.7.4) were not met: No package 'sqlite3' found

yum install sqlite-devel


configure: ERROR: Package requirements (oniguruma) were not met: No package 'oniguruma' found

yum install oniguruma oniguruma-devel


执行命令

php-fpm


出现错误
ERROR: failed to open configuration file '/usr/local/soft/php7/etc/php-fpm.conf': No such file or directory (2)
ERROR: failed to load configuration file '/usr/local/soft/php7/etc/php-fpm.conf'
ERROR: FPM initialization failed

cd /usr/local/soft/php7/etc/
cp php-fpm.conf.default php-fpm.conf



执行命令

展开阅读全文

本文系作者在时代Java发表,未经许可,不得转载。

如有侵权,请联系nowjava@qq.com删除。

编辑于

关注时代Java

关注时代Java