安装依赖
yum install -y epel-release
yum install -y libsodium libsodium-devel
yum config-manager --set-enabled PowerTools
yum -y install git vim gcc glibc-static telnet net-tools
yum --nogpgcheck -y install ImageMagick unzip libzip libzip-devel sqlite-devel lsof tree vim pcre pcre-devel openssl openssl-devel libicu-devel libwebp libwebp-devel gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses ncurses-devel curl curl-devel krb5-devel libidn libidn-devel openldap openldap-devel nss_ldap jemalloc-devel cmake boost-devel bison automake libevent libevent-devel gd gd-devel libtool* mhash libxslt libxslt-devel readline readline-devel gmp gmp-devel oniguruma oniguruma-devel traceroute
openjpeg-devel 可不加
编辑参数
./configure --prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--enable-fpm \
--with-fpm-user=webadmin \
--with-fpm-group=webadmin \
--with-sodium \
--enable-mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--enable-calendar \
--with-iconv \
--with-freetype \
--with-jpeg \
--with-webp \
--enable-gd-jis-conv \
--with-zlib \
--with-libxml \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-exif \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--enable-intl \
--enable-ftp \
--enable-gd \
--with-openssl \
--with-mhash \
--enable-sockets \
--with-xmlrpc \
--with-zip \
--enable-soap \
--with-gettext \
--enable-fileinfo \
--enable-opcache \
--with-pear \
--with-ldap=shared \
--without-gdbm \
--enable-maintainer-zts \
--enable-pcntl
安装中出现的问题
configure: error: Package requirements (oniguruma) were not met: Package 'oniguruma', required by 'virtual:world', not found
问题。
解决办法
centos7
yum -y install http://mirror.centos.org/centos-7/7.7.1908/cloud/x86_64/openstack-queens/oniguruma-6.7.0-1.el7.x86_64.rpm
yum -y install http://mirror.centos.org/centos-7/7.7.1908/cloud/x86_64/openstack-queens/oniguruma-devel-6.7.0-1.el7.x86_64.rpm
备用地址
oniguruma:http://down.24kplus.com/linux/oniguruma/oniguruma-6.7.0-1.el7.x86
oniguruma-devel:http://down.24kplus.com/linux/oniguruma/oniguruma-devel-6.7.0-1.el7.x86
centos8
- 获取源码,并解压
wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz -O oniguruma-6.9.4.tar.gz
tar -zxf oniguruma-6.9.4.tar.gz
cd oniguruma-6.9.4
备用下载: http://down.24kplus.com/linux/oniguruma/oniguruma-6.9.4.tar.gz
- 编译安装
./autogen.sh && ./configure --prefix=/usr
make && make install
No package 'libxml-2.0' found
configure: error: Package requirements (libxml-2.0 >= 2.7.6) were not met:
No package 'libxml-2.0' found
解决办法
yum install libxml2-devel
Cannot find ldap libraries in /usr/lib
cp -frp /usr/lib64/libldap* /usr/lib/
Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met
configure: error: Package requirements (icu-uc >= 50.1 icu-io icu-i18n) were not met:
No package 'icu-uc' found
No package 'icu-io' found
No package 'icu-i18n' found
解决办法
yum install libicu-devel
No package 'libxslt' found
configure: error: Package requirements (libxslt >= 1.1.0) were not met:
No package 'libxslt' found
--with-xsl
打开XSLT
文件支持,扩展了libXML2
库 ,需要libxslt
软件
解决办法
yum install libxslt-devel
No package 'freetype2' found
configure: error: Package requirements (freetype2) were not met:
No package 'freetype2' found
解决办法
yum install freetype-devel
libzip报错
解决办法:传送门
pbp7.4已弃用的配置项
下面这些选项已经无效了, 注意配置的时候不需要加上了
configure: WARNING: unrecognized options:
--with-libxml-dir,
--with-pcre-regex,
--with-pcre-dir,
--with-gd, 应该使用 --enable-gd
--with-jpeg-dir, 应该使用 --with-jpeg
--with-png-dir,
--with-freetype-dir, 应该使用 --with-freetype
--enable-mbregex-backtrack,
--with-onig,
--enable-wddx,
--with-libxml-dir,
--enable-zip 应该使用 --with-zip