PHP7 安装

来源:互联网 发布:ubuntu软件中心加载慢 编辑:程序博客网 时间:2024/03/29 21:10
参考文档:
http://www.jianshu.com/p/fc69f47fb7b8

Linux 服务器PHP7的安装,之前在服务器上已安装  php 5.6 版本,所以我没有去安装一些相关的依赖库了
下载
# cd /home/soft
# wget http://cn2.php.net/distributions/php-7.1.7.tar.gz 
# tar zxvf php-7.1.7.tar.gz 
# cd php-7.1.7
查看配置参数
# ./configure --help
# ./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysqli=mysqlnd --with-mysql-sock=/data/mysql/mysqld.sock --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-openssl --with-pcre-regex --with-pdo-mysql=/usr/local/mysql --with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip

安装出错
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
# yum install -y libxslt libxslt-devel

OK 继续配置 , 完成后, 编译 , 安装 
# make && make install

安装目录
# cd /home/soft/php-7.1.7 
# cp php.ini-development /usr/local/php7/etc/php.ini
# cd /usr/local/php7/etc
# cp php-fpm.conf.default php-fpm.conf
# cd /usr/local/php7/etc/php-fmp.d/
# cp www.conf.default www.conf

配置启动脚本
# cd /home/soft/php-7.1.7 
# cp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpm
# chmod 755 /etc/init.d/php7-fpm
# vim /usr/local/php7/etc/php-fpm.conf
在这文档中找到  
;pid = run/php-fpm.pid
pid = /usr/local/php7/var/run/php-fpm.pid
# chkconfig --add php7-fpm
# chkconfig php7-fpm on

启动
# /etc/init.d/php7-fpm start
关闭
# service php7-fpm stop





原创粉丝点击