centos7源码安装PHP7.3

hell0kitty 2019-12-27

1. 首先释放安装包:

tar -xvzf php-7.3.2.tar.gz.gz
cd php-7.3.2

 2. 接下来进行参数配置,配置前如果没有libxml2和libxml2-devel会报错,所以应该更新libxml2并安装libxml2-devel,使用在线安装:

yum -y install libxml2
yum -y install libxml2-devel
yum -y install opensslyum -y install openssl-develyum -y install curlyum -y install curl-develyum -y install libjpegyum -y install libjpeg-develyum -y install libpngyum -y install libpng-develyum -y install freetypeyum -y install freetype-develyum -y install pcreyum -y install pcre-develyum -y install libxsltyum -y install libxslt-develyum -y install bzip2yum -y install bzip2-devel
 
 
 
./configure --prefix=/usr/local/php --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip可能会报错,提示需要安装zlib查看yum是否安装,安装了还是提示错误的话就卸载了自己下载源码包编译安装,如果zlib版本大于1.2的话可能会提示cmake版本过低,要求升级cmake
下载Cmake
wget https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz
解压Cmake
将cmake移动到/usr/local/cmake3make && make install
cp php.ini-development /usr/local/php/lib/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp sapi/fpm/php-fpm /usr/local/binvim /usr/local/php/lib/php.ini打开php配置文件找到cgi.fix_pathinfo配置项,这一项默认被注释并且值为1
groupadd www-data
useradd -g www-data www-data
cp /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf
vim /usr/local/etc/php-fpm.d/www.conf默认user和group的设置为nobody,将其改为www-data
/usr/local/bin/php-fpm

相关推荐

TiDBPingCAP / 0评论 2020-07-29