centos PHP编译安装步骤
PHP安装
安装需要的依赖
yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel -y
yum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel -y
安装依赖libiconv
cd /server/tools/
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
tar zxf libiconv-1.16.tar.gz
cd libiconv-1.16
./configure --prefix=/application/libiconv
make
make install
检查依赖包
# rpm -qa zlib-devel libxml2-devel libjpeg-turbo-devel libiconv-devel
zlib-devel-1.2.7-18.el7.x86_64
libxml2-devel-2.9.1-6.el7_2.3.x86_64
libjpeg-turbo-devel-1.2.90-6.el7.x86_64
# rpm -qa freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel
libxslt-devel-1.1.28-5.el7.x86_64
freetype-devel-2.8-12.el7_6.1.x86_64
gd-devel-2.0.35-26.el7.x86_64
libcurl-devel-7.29.0-51.el7.x86_64
libpng-devel-1.5.13-7.el7_2.x86_64
安装PHP需要的依赖服务
yum install libmcrypt-devel -y
yum install mhash -y
yum install mcrypt -y
下载PHP包到 /server/tools/目录下
tar xf php-7.3.5.tar.gz
cd /php-7.3.5
编译 安装
./configure \
--prefix=/application/php-7.3.5 \
--enable-mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir=/application/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-gd \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-ftp \
--enable-opcache=no
make & make install
安装完成
菜鸟9528号,请求开炮。