具体的步骤如下所示:
下载和解压略
./configure \ --prefix=/application/php7 \ --with-config-file-path=/application/php7/etc \ --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-xmlrpc \ --with-xsl \ --with-zlib \ --with-zlib-dir \ --with-mhash \ --with-mcrypt \ --with-openssl-dir \ --with-jpeg-dir \ --enable-gd-jis-conv \ --enable-fpm \ --enable-bcmath \ --enable-libxml \ --enable-inline-optimization \ --enable-gd-native-ttf \ --enable-mbregex \ --enable-mbstring \ --enable-opcache \ --enable-pcntl \ --enable-shmop \ --enable-soap \ --enable-sockets \ --enable-sysvsem \ --enable-xml \ --enable-zip make && make install [root@teddy php-7.0.9]# cp php.ini-production /application/php7/etc/php.ini [root@teddy php-7.0.9]# cp /application/php7/etc/php-fpm.conf.default /application/php7/etc/php-fpm.conf [root@teddy php-7.0.9]# cp /application/php7/etc/php-fpm.d/www.conf.default /application/php7/etc/php-fpm.d/www.conf #增加opcache官方的php加速模块 //先确定opcache的路径 [root@teddy teddylu]# ls /application/php7/lib/php/extensions/no-debug-non-zts-20151012/opcache.so /application/php7/lib/php/extensions/no-debug-non-zts-20151012/opcache.so //打开配置文件vim /application/php7/etc/php.ini,在后面添加一下几行: zend_extension= /application/php7/lib/php/extensions/no-debug-non-zts-20151012/opcache.so opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.revalidate_freq=60 opcache.fast_shutdown=1 opcache.enable_cli=1 //启动nginx和php-fpm [root@teddy teddylu]# /application/php7/sbin/php-fpm
为wordpress升级php到最新的版本7