欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

centos7.2下编译安装php7.1.3步骤教程

程序员文章站 2022-08-31 19:38:32
centos7.2下编译安装php7.1.3步骤教程 centos 7 编译安装 php-7.1.3的步骤 在官网下载php-7.1.3的php压缩包,centos 7 安装 php-7....

centos7.2下编译安装php7.1.3步骤教程

centos 7 编译安装 php-7.1.3的步骤

在官网下载php-7.1.3的php压缩包,centos 7 安装 php-7.1.3的步骤

下载好后解压php-7.1.3.tar.gz压缩包,并进入解压后的目录

tar -zxvf php-7.1.3.tar.gz
cd php-7.1.3

安装php7需要的一些依赖库包 libxml2和一些其他依赖的扩展库

yum -y install libxml2 
yum -y install libxml2-devel 
yum -y install openssl 
yum -y install openssl-devel 
yum -y install curl-devel 
yum -y install libjpeg-devel 
yum -y install libpng-devel 
yum -y install freetype-devel
yum -y install bzip2-devel
yum -y install libmcrypt libmcrypt-devel
yum -y install postgresql-devel
yum -y install aspell-devel
yum -y install readline-devel
yum -y install libxslt-devel
yum -y install net-snmp-devel
yum -y install unixODBC-devel
yum -y install libicu-devel
yum -y install libc-client-devel
yum -y install libXpm-devel
yum -y install libvpx-devel
yum -y install enchant-devel
yum -y install openldap
yum -y install openldap-devel
yum -y install db4-devel
yum -y install gmp-devel
yum -y install sqlite-devel
yum -y install mysql-devel
#./configure --prefix=/usr/local/php --with-config-file-path=/etc/php \
                                    --with-apxs2=/usr/local/apache2/bin/apxs \
                                    --with-pdo-mysql=/usr \
                                    --with-libxml-dir=/usr/include/libxml2 \
                                    --enable-ssl --enable-cgi --enable-mods-shared=allable-ssl \
                                    --enable-cgi --enable-mods-shared=all \
                                    --enable-track-vars --enable-rewrite --enable-so

对php7进行编译和安装的操作

mkdir /etc/php
make
make install
config php
cp -f php.ini-development /etc/php/php.ini

编译成功,查看php版本

/usr/local/php/bin/php -v

运行php-fpm

/usr/local/php/sbin/php-fpm