1.第黄金年代安装正视包

1.率先安装重视包:

yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses curl gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel expat-devel xmlrpc-c xmlrpc-c-devel libicu-devel libmcrypt-devel libmemcached-devel

2.下载PHP压缩包并解压:

wget http://php.net/distributions/php-7.1.0.tar.gztar -zxvf php-7.1.0.tar.gzcd php-7.1.0

3.编译安装,编写翻译的时候只怕会忍俊不禁各样报错情状,下风度翩翩篇首要写编写翻译是遍布的错误及消除办法:

./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-fpm --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-soap --with-libxml-dir --with-xmlrpc --with-openssl --with-mcrypt --with-mhash --with-pcre-regex --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-libxml-dir --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear --enable-opcache

make && make install

5.安装成功后布置景况变量:

为了使用方便,能够在 /etc/profile文件末尾增多php情状变量 :

PATH=$PATH:/usr/local/php/bin export PATH

source /etc/profile #更新

echo $PATH

拜望php境况变量的门径后,未来就可以一直动用php命令了,查看php版本:

php -v

6.现行反革命的PHP未有.ini文件和配置文件,还须要配备PHP-FPM:

cp php.ini-production /etc/php.inicp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.confcp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.confcp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpmchmod +x /etc/init.d/php-fpm

php-fpm的运维、结束和重启:

service php-fpm start #启动service php-fpm stop #停止service php-fpm restart #重启

总结

如上所述是作者给大家介绍的CentOS7编写翻译安装php7.1的教程详细明白,希望对我们全体援救,如若我们有别的难点迎接给留言,笔者会及时回复我们的!

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

*
*
Website