1. 程式人生 > 其它 >PHP7.4編譯安裝問題解決

PHP7.4編譯安裝問題解決

PHP 7+ 版本極大地改進了效能,在一些WordPress基準測試當中,效能可以達到PHP 5.6的3倍。而PHP 5.6版本在2018年底官方已經不再維護,升級PHP 7是必然選擇。

centos7 編輯安裝php遇到的問題:

解決configure: error: no acceptable C compiler found in $PATH錯誤

yum install -y gcc gcc-c++

解決error:the HTTP XSLTmodulerequires the libxml2/libxslt錯誤

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

解決error:the HTTP image filtermodulerequires the GD library.錯誤

yum -y install gd-devel

解決error:theGeoIPmodulerequires theGeoIPlibrary.錯誤

yum -y install GeoIP GeoIP-devel GeoIP-data

解決error:theGoogleperftoolsmodulerequires theGoogleperftools錯誤

yum -y install gperftools

解決error:libatomic_ops library wasnotfound.錯誤

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

解決error trying toexec‘cc1plus’:execvp:Nosuch fileordirectory錯誤

yum -y install gcc-c++

解決error:[pool www]cannotgetuidforuser‘www-data’錯誤

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

解決configure:error:mbed TLS librariesnotfound.錯誤。
需要安裝mbedtls

CentOS 7/8 原始碼安裝 mbedtls 2.16.3, 解決configure:error:mbed TLS librariesnotfound.錯誤。

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

備用下載地址:https://down.24kplus.com/linux/mbedtls/mbedtls-2.16.3-gpl.tgz

2、編譯安裝

make
make DESTDIR=/usr install
ldconfig

如果出現make[1]:python2:Commandnotfound錯誤,執行:

yum -y install python2

如果出現/usr/bin/env:‘perl’:Nosuch fileordirectory錯誤,執行:

yum -y install perl

解決error:CannotfindOpenSSL’s <evp.h>錯誤

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

解決error:Libtoollibrary used but‘LIBTOOL’isundefined錯誤

yum install libtool

解決exec:g++:notfound錯誤

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

解決configure:error:tss libnotfound: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:libcryptonotfound.錯誤

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:Nosuch fileordirectory 錯誤

yum install e2fsprogs-devel uuid-devel libuuid-devel

解決configure:error:openssl libnotfound:libcrypto.so錯誤

yum install openssl-devel

解決tar(child):lbzip2:Cannotexec:Nosuch fileordirectory錯誤

yum -y install bzip2

解決configure:error:C++preprocessor“/lib/cpp”fails sanity check錯誤

yum install gcc-c++

解決configure:error:Pleasereinstall theBZip2distribution錯誤

yum install bzip2 bzip2-devel

解決configure:error:cURL version7.15.5orlaterisrequired to compile phpwithcURL support錯誤

yum install curl-devel

解決configure:error:notfound.Pleaseprovide a path toMagickWand-configorWand-config program錯誤

yum install ImageMagick-devel

解決configure:error:noacceptable C compiler foundin$PATH 錯誤

yum install gcc

解決configure:error:Packagerequirements(icu-uc>=50.1icu-io icu-i18n)werenotmet:錯誤

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

使用原始碼安裝。

wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz -O oniguruma-6.9.4.tar.gz 
tar -zxvf oniguruma-6.9.4.tar.gz
cd oniguruma-6.9.4/
./autogen.sh
./configure
make
sudo make install

解決 bash: make: 未找到命令…

需要安裝gcc,執行一下就可以了:

yum -y install gcc automake autoconf libtool make
yum install gcc gcc-c++

解決 configure: error: Package requirements (libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0) were not met:

Package ‘libzip’, required by ‘virtual:world’, not found
Package ‘libzip’, required by ‘virtual:world’, not found
Package ‘libzip’, required by ‘virtual:world’, not found

第一步:

rpm -q libzip rpm -q libzip-devel 檢視是否有安裝過,如果有,解除安裝它。yum remove libzip-devel libzip

第二步:

下載

wget https://libzip.org/download/libzip-1.7.3.tar.gz

解壓

tar -xvf libzip-1.7.3.tar.gz

安裝cmake3

yum install -y cmake3
sudo ln -sf /usr/bin/cmake3 /usr/bin/cmake

安裝libzip

cd libzip-1.7.3/
mkdir build && cd build
cmake ..
make && make install

原始碼地址

https://pkgs.org/search/?q=libzip

通過原始碼安裝

yum install http://mirror.centos.org/centos/8/AppStream/x86_64/os/Packages/libzip-1.5.2-1.module_el8.2.0+314+53b99e08.x86_64.rpm
yum install http://mirror.centos.org/centos/8/AppStream/x86_64/os/Packages/libzip-devel-1.5.2-1.module_el8.2.0+314+53b99e08.x86_64.rpm

解決 No package ‘libxml-2.0’ found缺失libxml2.0 庫,錯誤:

yum -y install libxml2
yum -y install libxml2-devel

解決 configure: error: Package requirements (libxslt >= 1.1.0) were not met:No package ‘libxslt’ found錯誤

yum install libxslt-devel

解決 configure: error: Package requirements (libpng) were not met:No package ‘libpng’ found錯誤

yum install libpng-devel

解決 configure: error: Cannot find ldap.h 錯誤

yum install openldap
yum install openldap-devel

解決 configure: error: Cannot find ldap libraries in /usr/lib 錯誤

cp -frp /usr/lib64/libldap* /usr/lib/

解決 configure: error: Package requirements (libcurl >= 7.15.5) were not met: 錯誤

yum install libcurl-devel

解決 configure: error: Package requirements (krb5-gssapi krb5) were not met:

yum -y install krb5-devel

解決 configure: error: Package requirements (libjpeg) were not met:

yum install -y libjpeg-devel

解決 configure: error: Package requirements (freetype2) were not met:

yum -y install freetype freetype-devel

解決 configure: error: Package requirements (libpcre2-8 >= 10.30) were not met:

wget https://ftp.pcre.org/pub/pcre/pcre2-10.35.tar.gz
tar xzvf pcre2-10.35.tar.gz
cd pcre2-10.35

./configure --prefix=/usr/local/pcre2 \
--enable-pcre2-16 \
--enable-pcre2-32 \
--enable-jit \
--enable-jit-sealloc

make && make install

export PKG_CONFIG_PATH=/usr/local/pcre2/lib/pkgconfig/

轉載:https://df-l.com/230.html
你關注的人都在努力變的更好,你還在等什麼呢。