centos7编译安装php7.1
安装依赖: [html]view plain copy yum-yinstallgccgcc-c++libxml2libxml2-develbzip2bzip2-devellibmcryptlibmcrypt-developensslopenssl-devellibcurl-devellibjpeg-devellibpng-develfreetype-develreadlinereadline-devellibxslt-develperlperl-develpsmisc.x86_64recoderecode-devellibtidylibtidy-devel mcryptmhash 下载及解压php7.1: [html]view plain copy wgethttp://cn2.php.net/distributions/php-7.1.0.tar.gz tarzxvfphp-7.1.0.tar.gz cdphp-7.1.0 配销魂淑女 黯然销魂 寸寸销魂置及安装php7.1: [html]view plain copy ./configure\ --prefix=/usr/local/php7\ --exec-prefix=/usr/local/php7\ --bindir=/usr/local/php7/bin\ --sbindir=/usr/local/php7/sbin\ --includedir=/usr/local/php7/include\ --libdir=/usr/local/php7/lib/php\ --mandir=/usr/local/php7/php/man\ --with-config-file-path=/usr/local/php7/etc\ --with-mysql-sock=/usr/local/mysql/mysql.sock\ --with-mcrypt=/usr/include\ --with-mhash\ --with-openssl\ --with-mysql=shared,mysqlnd\ --with-mysqli=shared,mysqlnd\ --with-pdo-mysql=shared,mysqlnd\ --with-gd\ --with-iconv\ --with-zlib\ --enable-zip\ --enable-inline-optimization\ --disable-debug\ --disable-rpath\ --enable-shared\ --enable-xml\ --enable-bcmath\ --enable-shmop\ --enable-sysvsem\ --enable-mbregex\ --enable-mbstring\ --enable-ftp\ --enable-gd-native-ttf\ --enable-pcntl\ --enable-sockets\ --with-xmlrpc\ --enable-soap\ --without-pear\ --with-gettext\ --enable-session\ --with-curl\ --with-jpeg-dir\ --with-freetype-dir\ --enable-opcache\ --enable-redis\ --enable-fpm\ --enable-fastcgi\ --with-fpm-user=www\ --with-fpm-group=www\ --without-gdbm\ --disable-fileinfo make&&makeinstall 拷贝配置文件: [html]view plain copy cp/usr/local/php-7.1.0/php.ini-production/usr/local/php7/etc/php.ini cp/usr/local/php7/etc/php-fpm.conf.default/usr/local/php7/etc/php-fpm.conf cp/usr/local/php7/etc/php-fpm.d/www.conf.default/usr/local/php7/etc/php-fpm.d/www.conf cp/usr/local/php-7.1.0/sapi/fpm/php-fpm.service/lib/systemd/system/php-fpm.service 编辑php-rpm.conf,将pid=run/php-fpm.pid开启 创建php相关目录及给予权限: [html]view plain copy mkdir-p/var/log/php/ mkdir-p/var/log/php-fpm/ mkdir-p/run/php-fpm/ mkdir-p/var/lib/php/session touch/dev/shm/php-fpm.sock chownwww.www/dev/shm/php-fpm.sock chmod777/dev/shm/php-fpm.sock chown-Rwww:www/var/lib/php