PHP install

PHP7 整合了 Fastcgi 

启动项变成了 php-fpm

首先要安装php所需要的依赖库

yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-defel libxml2 libxml2-devel pcre-devel curl-devel libxslt-devel

 

 

// 下载php

 wget http://php.net/distributions/php-7.0.23.tar.xz   

 

 

//解压

 xz -d php-7.0.23.tar.xz

 

//拆包

tar xvf php-7.0.23.tar

cd php-7.0.23

 

 

//编译-具体配置选项 google  百度查询 都有解释

# ./configure --prefix=/usr/local/php \

 --sbin-path=/usr/sbin/php \

 --bin-path=/usr/bin/php \

 --with-curl \

 --with-freetype-dir \

 --with-gd \

 --with-gettext \

 --with-iconv-dir \

 --with-kerberos \

 --with-libdir=lib64 \

 --with-libxml-dir \

 --with-mysqli \

 --with-openssl \

 --with-pcre-regex \

 --with-pdo-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

 

 

note:"在配置中 注意 是否有错误和缺少依赖包的提示,如果有就自行添加"

 

编译安装

make&&make install

 

 

 

 

配置文件cp

//php-fpm的引用文件

 cp /usr/local/php/etc/php-fpm.conf.default    /usr/local/php/etc/php-fpm.conf

 

//将php-fpm启动 移动到init.d 开机启动

cp -R ./sapi/fpm/php-fpm   /etc/init.d/php-fpm    

 

 

# php -v   出现下面的提示就ok了

posted @ 2017-09-10 16:38  慧宁师  阅读(266)  评论(0编辑  收藏  举报