#! /bin/bash# #编译安装 PHP7CD/root/soft | |mkdir/root/soft && cd/root/Softwgethttp//cn2.php.net/distributions/php-7.0.12.tar.gzTar-ZXVF php-7.0. A.Tar. GZCD php-7.0. A./configure--PREFIX=/USR/LOCAL/PHP7--sysconfdir=/usr/local/php7/etc--with-config-file-path=/usr/local/php7/etc--with-config-file-scan-dir=/USR/LOCAL/PHP7/ETC/PHP.D--enable-fpm--enable-mbstring--enable-Zip--enable-mysqlnd--with-iconv--with-zlib--enable-xml--with-curl--with-gd--with-openssl--with-mhash--enable-so Ckets--with-xmlrpc--enable-Zip--enable-soap--enable-opcache--with-pdo-mysql--enable-maintainer-Zts Make Clear Make&& Make Installmkdir/USR/LOCAL/PHP7/ETC/PHP.D-PCD/root/soft/php-7.0. A/sapi/FPMCPinit.d.php-fpm/etc/init.d/php7-FPMchmod+x/etc/init.d/php7-Fpmchkconfig--add php7-fpmchkconfig PHP7-FPM onCPphp-fpm.conf/usr/local/php7/etc/php-fpm.confCPwww.conf/usr/local/php7/etc/php-fpm.d/WWW.CONFCD/root/soft/php-7.0. ACPphp.ini-production/usr/local/php7/etc/php.iniCat>/usr/local/php7/etc/php.d/Ten-opcache.ini <<eoffzend_extension=opcache.soopcache.enable=1opcache.memory_consumption= -Opcache.interned_strings_buffer=8Opcache.max_accelerated_files=4000Opcache.blacklist_filename=/etc/php.d/opcache*. blacklisteoff# #redis ExtensionYum Install Unzip-y cd/root/Softwget-C https://Github.com/phpredis/phpredis/archive/php7.zipUnzipPhp7.ZipCD Phpredis-php7//usr/local/php7/bin/phpize./configure--with-php-config=/usr/local/php7/bin/php-Config Make Make InstallEcho "extension=redis.so">>/usr/local/php7/etc/php.d/ -. redis.ini###### #igbinary7扩展cd/root/SoftwgetHttps//Github.com/igbinary/igbinary7/archive/master.zipCD igbinary7-Master/usr/local/php7/bin/phpize./configure cflags="-o2-g"--enable-igbinary--with-php-config=/usr/local/php7/bin/php-ConfigEcho "extension=igbinary.so">>/usr/local/php7/etc/php.d/ -. Igbinary.iniEcho "session.serialize_handler=igbinary">>/usr/local/php7/etc/php.d/ -. igbinary.ini# #memcache扩展cd/root/SoftYum Install-Y libmemcached10-devel-1.0. --1. ius.centos6.x86_64 libmemcached10-1.0. --1. ius.centos6.x86_64wgetHttps//CODELOAD.GITHUB.COM/PHP-MEMCACHED-DEV/PHP-MEMCACHED/ZIP/PHP7Unzipphp7cd PHP-memcached-php7//usr/local/php7/bin/phpize./configure--with-php-config=/usr/local/php7/bin/php-config--enable-memcached-igbinary Make Make InstallEcho "extension=memcached.so">>/usr/local/php7/etc/php.d/ -. Memcached.ini
Compiling and installing PHP7