#centos6.5_x86_64 下 Nginx 1.10.1、PHP7 安装记录 #np7install.sh #安装依赖包: yum install -y openssl-devel pcre-devel libxml2-devel libxslt-devel gd-devel geoip-devel zlib-devel gzip-devel curl-devel libwebp-devel libmcrypt-devel MysqL Nginx PHP5 PHP-fpm #升级开始: #安装Nginx1.10.1源码包编译安装: wget http://Nginx.org/download/Nginx-1.10.1.tar.gz tar xzf Nginx-1.10.1.tar.gz cd Nginx-1.10.1 ./configure --prefix=/usr/share/Nginx --sbin-path=/usr/sbin/Nginx --conf-path=/etc/Nginx/Nginx.conf --error-log-path=/data/log/Nginx/error.log --http-log-path=/data/log/Nginx/access.log --http-client-body-temp-path=/var/lib/Nginx/tmp/client_body --http-proxy-temp-path=/var/lib/Nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/Nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/Nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/Nginx/tmp/scgi --pid-path=/var/run/Nginx.pid --lock-path=/var/lock/subsys/Nginx --user=Nginx --group=Nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=-Wl,-E && make && make install #安装PHP7.0.8源码包: wget -O PHP7.0.8.tar.gz http://cn2.PHP.net/get/PHP-7.0.8.tar.gz/from/this/mirror tar xzf PHP7.0.8.tar.gz cd PHP-7.0.8 ./configure --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --with-config-file-path=/etc --with-config-file-scan-dir=/etc/PHP.d --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-mcrypt --with-MysqLi --with-pdo-MysqL --with-gd --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbstring --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=/usr/lib64 --with-png-dir=/usr/lib64 --with-webp-dir=/usr/lib64 --with-freetype-dir=/usr/lib64 && make && make install #安装PHP7 memcache扩展 wget http://o97qqi41i.bkt.clouddn.com/pecl-memcache-PHP7.tar.gz tar xzf pecl-memcache-PHP7.tar.gz cd pecl-memcache-PHP7 PHPize ./configure && make && make install echo 'extension=memcache.so' >> /etc/PHP.ini #安装 mongo-PHP-driver,不得不多说两句,PHP7的mongodb扩展真是够恶心的。类名长的要命,而且文档相当不完善。很多使用方法基本是猜着用。 wget http://o97qqi41i.bkt.clouddn.com/mongo.tar.gz tar xzf mongo.tar.gz cd mongo-PHP-driver PHPize ./configure && make && make install echo 'extension=mongodb.so' >> /etc/PHP.ini #启动服务 /etc/init.d/PHP-fpm start /etc/init.d/Nginx start