本文是自己根据
别的
人的方法
一步步装置
,留作记录。第一步:下载php装置
文件到本地[root@izm5e9rt5ix8dl9ar3j777z local]# wget http://cn2.php.NET/distributions/php-7.1.16.tar.gz--2018-05-28 21:07:53-- http://cn2.php.net/distributions/php-7.1.16.tar.gzResolving cn2.php.net (cn2.php.net)... 36.51.255.144Connecting to cn2.php.net (cn2.php.net)|36.51.255.144|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 19470983 (19M) [application/x-gzip]Saving to: ‘php-7.1.16.tar.gz’100%[===============================================================================================================================================================================================>] 19,470,983 5.70MB/s in 3.3s 2018-05-28 21:07:57 (5.70 MB/s) - ‘php-7.1.16.tar.gz’ saved [19470983/19470983]
第二部:解压文件 tar zxvf php-7.1.16.tar.gz
第三部:装置
cd php-7.1.16 运转
./configure --enable-fpm --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc 错误:configure: error: libxml2 not found. Please check your libxml2 installation. 短少
libxml2,so我去装置
yum install libxml2-devel yum install gcc 最佳
都装置
了,我这里都实验了一遍。 然后
别忘了再次实验./configure --enable-fpm --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc,你再提示信息的最反面发明
如下信息体现乐成: +--------------------------------------------------------------------+ | License: || This software is subject to the PHP License, available in this | | distribution in the file LICENSE. By continuing this installation | | process, you are bound by the terms of this license agreement. | | If you do not agree with the terms of this license, you must abort | | the installation process at this point. | +--------------------------------------------------------------------+ Thank you for using PHP. config.status: creating php7.specconfig.status: creating main/build-defs.hconfig.status: creating scripts/phpizeconfig.status: creating scripts/man1/phpize.1config.status: creating scripts/php-configconfig.status: creating scripts/man1/php-config.1config.status: creating sapi/cli/php.1config.status: creating sapi/fpm/php-fpm.confconfig.status: creating sapi/fpm/www.confconfig.status: creating sapi/fpm/init.d.php-fpmconfig.status: creating sapi/fpm/php-fpm.serviceconfig.status: creating sapi/fpm/php-fpm.8config.status: creating sapi/fpm/status.htmlconfig.status: creating sapi/cgi/php-cgi.1config.status: creating ext/phar/phar.1config.status: creating ext/phar/phar.phar.1config.status: creating main/php_config.hconfig.status: executing default commands 然后
实验: make && make install 时间
很长,耐烦等候,步伐
刷屏,可以漠视
去干此外
了。 末了看到如下提示: Build complete. Don't forget to run 'make test'. Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/Installing PHP CLI binary: /usr/local/php/bin/Installing PHP CLI man page: /usr/local/php/php/man/man1/Installing PHP FPM binary: /usr/local/php/sbin/Installing PHP FPM defconfig: /usr/local/php/etc/Installing PHP FPM man page: /usr/local/php/php/man/man8/Installing PHP FPM status page: /usr/local/php/php/php/fpm/Installing phpdbg binary: /usr/local/php/bin/Installing phpdbg man page: /usr/local/php/php/man/man1/Installing PHP CGI binary: /usr/local/php/bin/Installing PHP CGI man page: /usr/local/php/php/man/man1/Installing build environment: /usr/local/php/lib/php/build/Installing header files: /usr/local/php/include/php/Installing helper programs: /usr/local/php/bin/ program: phpize program: php-configInstalling man pages: /usr/local/php/php/man/man1/ page: phpize.1 page: php-config.1Installing PEAR environment: /usr/local/php/lib/php/[PEAR] Archive_Tar - installed: 1.4.3[PEAR] Console_Getopt - installed: 1.4.1[PEAR] Structures_Graph- installed: 1.1.1[PEAR] XML_Util - installed: 1.4.2[PEAR] PEAR - installed: 1.10.5Wrote PEAR system config file at: /usr/local/php/etc/pear.confYou may want to add: /usr/local/php/lib/php to your php.ini include_path/usr/local/php-7.1.16/build/shtool install -c ext/phar/phar.phar /usr/local/php/binln -s -f phar.phar /usr/local/php/bin/pharInstalling PDO headers: /usr/local/php/include/php/ext/pdo/
配置
(如下
配置
都是我团体
的途径
配置
大家
请按照
各自途径
配置
)cp php.ini-development /usr/local/lib/php.ini cp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpm chmod +x /etc/init.d/php7-fpm cd /usr/local/php/etc cp php-fpm.conf.default php-fpm.conf cp php-fpm.d/www.conf.default php-fpm.d/www.conf #配置
停止
/etc/init.d/php7-fpm start 启动php
来源:https://www.jianshu.com/p/3e9e97c4cab8 免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |