系统相关
首页 > 系统相关> > Centos 6 安装 php7.3.x

Centos 6 安装 php7.3.x

作者:互联网

CentOS6 不支持 php7.4版本的安装了(可能是我技术不行)

php7.3.x编译安装。

// 后面会提示 system libzip must be upgraded to version >= 0.11 所以提前卸载,自己编译。

yum -y remove libzip-devel libzip

// 就下载这个版本,别下载太高的,centos6上编译不过

wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make -j
make install

 

// 下载PHP

wget https://www.php.net/distributions/php-7.3.24.tar.gz

tar -zxvf php-7.3.24.tar.gz

cd php-7.3.24.tar.gz

 

// 编译

./configure \
--prefix=/usr/local/php73 \
--with-config-file-path=/usr/local/php73/etc \
--enable-fpm \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-soap \
--with-libxml-dir \
--with-xmlrpc \
--with-openssl \
--with-mhash \
--with-pcre-regex \
--with-sqlite3 \
--with-zlib \
--enable-bcmath \
--with-iconv \
--with-bz2 \
--enable-calendar \
--with-curl \
--with-cdb \
--enable-dom \
--enable-exif \
--enable-fileinfo \
--enable-filter \
--with-pcre-dir \
--enable-ftp \
--with-gd \
--with-openssl-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-freetype-dir \
--enable-gd-jis-conv \
--with-gettext \
--with-gmp \
--with-mhash \
--enable-json \
--enable-mbstring \
--enable-mbregex \
--enable-mbregex-backtrack \
--with-onig \
--enable-pdo \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-zlib-dir \
--with-pdo-sqlite \
--with-readline \
--enable-session \
--enable-shmop \
--enable-simplexml \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-libxml-dir \
--with-xsl \
--enable-zip \
--enable-mysqlnd-compression-support \
--with-pear \
--enable-opcache

 

make -j

make install 

 

// 配置文件修改:

cp php.ini-production /usr/local/php73/etc/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php73-fpm
cp /usr/local/php73/etc/php-fpm.conf.default /usr/local/php73/etc/php-fpm.conf
cp /usr/local/php73/etc/php-fpm.d/www.conf.default /usr/local/php73/etc/php-fpm.d/www.conf

 

#php-fpm 端口可在 www.conf 里修改

chmod +x /etc/init.d/php73-fpm

/etc/init.d/php73-fpm start

# php73加入环境变量
ln -s /usr/local/php73/bin/php /usr/local/bin/php73

#开机自启动
vim /etc/rc.local
/etc/init.d/php73-fpm start

 

# 修改不显示X-Power-By

vim /usr/local/php73/etc/php.ini

找到 expose_php

把 on 改为 off

/etc/init.d/php73-fpm restart

 

标签:enable,Centos,etc,--,php73,php7.3,fpm,php,安装
来源: https://www.cnblogs.com/dwj192/p/14003399.html