yum install -y gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curl curl-devel openssl-devel gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel libwebp-devel libwebp libjpeg-turbo-devel libedit-devel
cd
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar xvf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=/usr
make && sudo make install
cd
wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
tar xvf automake-1.14.tar.gz
cd automake-1.14
./configure --prefix=/usr
make && sudo make install
cd
wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz
tar xvf bison-2.5.1.tar.gz
cd bison-2.5.1
./configure --prefix=/usr
make && sudo make install
yum remove libzip -y
cd
wget http://rpms.remirepo.net/enterprise/6/remi/x86_64//libzip-last-1.1.3-1.el6.remi.x86_64.rpm
rpm -Uvh libzip-last-1.1.3-1.el6.remi.x86_64.rpm
wget http://rpms.remirepo.net/enterprise/6/remi/x86_64//libzip-last-devel-1.1.3-1.el6.remi.x86_64.rpm
rpm -Uvh libzip-last-devel-1.1.3-1.el6.remi.x86_64.rpm
cd
wget https://www.php.net/distributions/php-7.3.9.tar.gz
tar -xvf php-7.3.9.tar.gz
cd php-7.3.9
./buildconf --force
./configure --prefix=/usr/local/php7.3.9 --with-config-file-scan-dir=/usr/local/php7.3.9/etc --enable-fpm --enable-calendar --enable-ctype --enable-dom --enable-exif --enable-fileinfo --enable-filter --enable-hash --enable-json --enable-libxml --enable-mbstring --enable-opcache --enable-pcntl --enable-phar --enable-pdo --enable-posix --enable-session --enable-simplexml --enable-soap --enable-tokenizer --enable-xml --enable-xmlreader --enable-xmlwriter --enable-zip --enable-gd-native-ttf --with-mcrypt --with-bz2 --with-curl --with-freetype-dir --with-gd --with-iconv --with-jpeg-dir --with-openssl --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-png-dir --with-readline --with-zlib
make && make install
cp ~/php-7.3.9/php.ini-development /usr/local/php7.3.9/etc/php.ini
cp /usr/local/php7.3.9/etc/php-fpm.conf.default /usr/local/php7.3.9/etc/php-fpm.conf
cp /usr/local/php7.3.9/etc/php-fpm.d/www.conf.default /usr/local/php7.3.9/etc/php-fpm.d/www.conf
php 5.3.3 以后不再支持 sbin/php-fpm (start|stop|reload),需要使用信号控制。
master进程可以理解以下信号: INT, TERM 立刻终止 QUIT 平滑终止 USR1 重新打开日志文件 USR2 平滑重载所有worker进程并重新载入配置和二进制模块
在 php-fpm.conf 文件,打开 pid 注释行(去除前面的 ;)
vi /usr/local/php7.3.9/etc/php-fpm.conf
pid = run/php-fpm.pid
php-fpm 启动:
/usr/local/php7.3.9/sbin/php-fpm
php-fpm 关闭:
kill -INT `cat /usr/local/php7.3.9/var/run/php-fpm.pid`
php-fpm 重启:
kill -USR2 `cat /usr/local/php7.3.9/var/run/php-fpm.pid`