The compiler installed php

  

1. Install the required environment

yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libzip-devel pcre-devel

 

2. Download and install PHP

1. 下载
wget http://cn2.php.net/distributions/php-7.3.3.tar.gz

2. 解压
tar -xzf php-7.3.3.tar.gz

3. 进入目录
cd php7.3.3

4. 编译php
./configure --prefix=/usr/local/php7 \
--with-config-file-path=/usr/local/php7/etc \
--with-config-file-scan-dir=/usr/local/php7/etc/php.d \
--with-mcrypt=/usr/include \
--enable-mysqlnd \
--with-mysqli \
--with-pdo-mysql \
--enable-fpm \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--with-gd \
--with-iconv \
--with-zlib \
--enable-xml \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-ftp \
--enable-gd-native-ttf \
--with-openssl \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--without-pear \
--with-gettext \
--enable-session \
--with-curl \
--with-jpeg-dir \
--with-freetype-dir \
--enable-opcache

  Compile, install

the make install && the make - j2

 -j: Enable two tasks

 

3. Configure PHP

  1) Copy the ini file

cp php.ini-production /usr/local/php7/etc/php.ini

  2) Configuration fpm

cd /usr/src/php-7.0.0/sapi/fpm

cp init.d.php-fpm /etc/init.d/php-fpm

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

chkconfig --add php-fpm

chkconfig php-fpm on

Guess you like

Origin www.cnblogs.com/xingxia/p/php-fpm_install_b.html