编译安装php 7.2 加载redis扩展

!/bin/bash

#
##### 编译安装php7.2.5
##### 添加redis插件
#

yum install -y gcc gcc-c++ libxml2 libxml2-devel openssl openssl-devel curl curl-devel libjpeg-devel libpng-devel libpng freetype freetype-devel libmcrypt prefix libicu-devel libxslt-devel* autoconf wget
cd /usr/src/
curl -C – -o php-7.2.5.tar.gz https://www.php.net/distributions/php-7.2.5.tar.gz
tar xf php-7.2.5.tar.gz -C /usr/src/
cd /usr/src/php-7.2.5/
./configure –prefix=/data/php7 –with-mhash –with-openssl –with-config-file-path=/data/php7/etc –enable-fpm –enable-xml –with-libxml-dir –enable-bcmath –enable-calendar –enable-intl –enable-mbstring –enable-pcntl –enable-shmop –enable-soap –enable-sockets –enable-zip –enable-mbregex –enable-mysqlnd –enable-mysqlnd-compression-support –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd –with-gd –enable-ftp –with-curl –with-xsl –with-iconv –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –enable-sysvsem –enable-inline-optimization –with-xmlrpc –with-gettext
make && make install
cp php.ini-production /data/php7/etc/php.ini
cp /data/php7/etc/php-fpm.conf.default /data/php7/etc/php-fpm.conf
mv /data/php7/etc/php-fpm.d/www.conf.default /data/php7/etc/php-fpm.d/www.conf
cd
curl -O http://pecl.php.net/get/redis-4.0.2.tgz
tar xf redis-4.0.2.tgz -C /usr/src
cd /usr/src/redis-4.0.2/
/data/php7/bin/phpize
./configure –with-php-config=/data/php7/bin/php-config
make && make install
echo “extension=redis.so” >> /data/php7/etc/php.ini
/data/php7/sbin/php-fpm
ps -ef | grep ‘[p]hp-fpm: master process’

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注