安装依赖组件,执行php安装配置
wget https://github.com/skvadrik/re2c/releases/download/1.0.2/re2c-1.0.2.tar.gz tar -zxvf re2c-1.0.2.tar.gz cd re2c-1.0.2 ./configure make && make install cd .. wget -O php7.tar.gz tar -zxvf php7.tar.gz cd php-7.1.8 ln -s /usr/lib64/libc-client.so /usr/lib/ ln -s /usr/lib64/libssl.so /usr/lib/ ln -s /usr/lib64/libldap.so /usr/lib/ ./configure \ --enable-fpm \ --enable-ctype \ --enable-dom \ --enable-xml \ --enable-json \ --enable-mbstring \ --enable-posix \ --enable-simplexml \ --enable-xmlreader \ --enable-xmlwriter \ --enable-zip \ --enable-fileinfo \ --enable-intl \ --enable-ftp \ --enable-exif \ --enable-pcntl \ --enable-sockets \ --enable-session \ --enable-gd-native-ttf \ --enable-gd-jis-conv \ --enable-inline-optimization \ --enable-shared \ --enable-bcmath \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-mbregex \ --enable-pcntl \ --with-pdo-mysql \ --with-mhash \ --with-libxml-dir \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-iconv-dir \ --with-zlib \ --with-curl \ --with-bz2 \ --with-mcrypt \ --with-openssl \ --with-xsl \ --with-pcre-dir \ --with-pear \ --with-freetype-dir \ --with-xmlrpc \ --with-gettext \ --with-readline \ --with-recode \ --with-tidy \ --with-ldap \ --with-gmp \ --with-kerberos编辑MakeFile,找到开头是 ‘EXTRA_LIBS = ’ 这一行,在结尾加上’-llber’
EXTRA_LIBS = -lcrypt -lcrypto -lssl -lcrypto -lz -lexslt -ltidy -lresolv -lcrypt -lrecode -lreadline -lncurses -lrt -lmcrypt -lldap -lstdc++ -lgmp -lpng -lz -ljpeg -lcrypto -lssl -lcrypto -lcurl -lbz2 -lz -lcrypto -lssl -lcrypto -lrt -lm -ldl -lnsl -lxml2 -lz -lm -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lxml2 -lz -lm -ldl -lfreetype -ldl -lm -licui18n -licuuc -licudata -ldl -lm -licuio -lxml2 -lz -lm -ldl -lcrypt -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxslt -lxml2 -lz -ldl -lm -lcrypt -llber然后编译安装
make && make install mkdir -p /var/lib/php/session chown nginx:nginx -R /var/lib/php/session/ cp php.ini-production /usr/local/etc/php.ini cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf cp /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf编辑/usr/local/etc/php-fpm.conf,最后一行改成
include=etc/php-fpm.d/*.conf编辑/usr/local/etc/php-fpm.d/www.conf
;修改user和group这两行,大概在20行左右 user = nginx group = nginx ;取消这行的注释,���概在第60行左右 listen.allowed_clients = 127.0.0.1 ;取消这几行的注释,大概在第330行左右 env[HOSTNAME] = $HOSTNAME env[PATH] = /usr/local/bin:/usr/bin:/bin env[TMP] = /tmp env[TMPDIR] = /tmp env[TEMP] = /tmp