1、安装必要的依赖库

> yum -y install gd zlib libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel openssl openssl-devel curl-devel libxslt-devel
2、下载php源码包
http://php.net/downloads.php

文件名为:php-7.0.4.tar.gz

 
3、解压源码包
> tar -zxvf php-7.0.4.tar.gz
4、进入目录,并configure
./configure --prefix=/data/nmp/php \
--with-curl \
--with-freetype-dir \
--with-gd \
--with-gettext \
--with-iconv-dir \
--with-kerberos \
--with-libdir=lib \
--with-libxml-dir \
--with-mysqli=mysqlnd \
--with-openssl \
--with-pcre-regex \
--with-pdo-mysql=mysqlnd \
--with-pdo-sqlite \
--with-pear \
--with-png-dir \
--with-xmlrpc \
--with-xsl \
--with-zlib \
--enable-mysqlnd \
--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 \
--enable-pthreads \
--enable-maintainer-zts \
--enable-fileinfo
5、make && make install
> make && make install
6、配置文件
> cp php.ini-development /data/nmp/php/lib/php.ini
> cp /data/nmp/php/etc/php-fpm.conf.default /data/nmp/php/etc/php-fpm.conf
> cp /data/nmp/php/etc/php-fpm.d/www.conf.default /data/nmp/php/etc/php-fpm.d/www.conf
> cp -R ./sapi/fpm/php-fpm /data/nmp/php/etc/init.d/php-fpm
(*需要创建init.d目录)
 
7、启动
> /data/nmp/php/etc/init.d/php-fpm
8、nginx整合php
> vi /data/nmp/nginx/conf/nginx.conf
server {
listen 80;
server_name localhost; charset utf-8; #root网站的目录
location / {
root /data/wwwroot;
index index.html index.htm index.php;
} location ~ \.php$ { #网站目录
root /data/wwwroot;
#phpcgi端口,默认9000
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php; #document_root指向的就是网站目录
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
9、重新加载nginx
> /data/nmp/nginx/sbin/nginx -s reload

centos6.6 下 安装 php7 按 nginx方式的更多相关文章

  1. centos6.4下安装php7+nginx+mariadb环境

    一,安装php71,创建php用户和用户组,并在github下载php7源码#新建php用户和php组# groupadd -r php && useradd -r -g php -s ...

  2. CentOS6.5下安装Apache2.4+PHP7

    CentOS6.5下安装Apache2.4+PHP7 http://blog.csdn.net/along602/article/details/42695779 http://www.th7.cn/ ...

  3. CentOS6.5下安装apache2.2和PHP 5.5.28

    CentOS6.5下安装apache2.2 1. 准备程序 :httpd-2.2.27.tar.gz 下载地址:http://httpd.apache.org/download.cgi#apache2 ...

  4. CentOS6.5下安装JDK1.7+MYSQL5.5+TOMCAT7+nginx1.7.5环境安装文档

    ----------------CentOS6.5下安装JDK1.7+MYSQL5.5+TOMCAT7+nginx1.7.5环境安装文档----------------------- [JDK1.7安 ...

  5. 【转载】CentOS6.5_X64下安装配置MongoDB数据库

    [转载]CentOS6.5_X64下安装配置MongoDB数据库 2014-05-16 10:07:09|  分类: 默认分类|举报|字号 订阅      下载LOFTER客户端 本文转载自zhm&l ...

  6. Linux下安装与配置Nginx

    一.准备 Nginx版本:nginx-1.7.7.tar.gz   请自行到官网下载对应的版本. 二.步骤 ♦在Linux新建一个queenLove用户 [root@localhost /]# use ...

  7. 建站笔记1:centos6.5下安装mysql

    近期买了个域名,想要玩玩自己建站点:接下来遇到的问题都会一次记录下来.以备自己以后复习查看: 首先建站方案选择: wordPress +centos6.5 +mysql; server买的:搬瓦工最低 ...

  8. window下安装php7的memcache扩展

    安装memcache:http://www.runoob.com/memcached/memcached-connection.html1.4.4 c:\memcached\memcached.exe ...

  9. CentOS6.5下安装配置MySQL

    CentOS6.5下安装配置MySQL,配置方法如下: 安装mysql数据库:# yum install -y mysql-server mysql mysql-deve 查看mysql-server ...

随机推荐

  1. rman备份恢复命令之switch(转)

    一 switch 命令1 switch命令用途更新数据文件名为rman下镜像拷贝时指定的数据文件名更新数据文件名为 set newname 命令指定的名字. 2 switch 命令使用前提条件rman ...

  2. python输出格式化及函数format

    格式    描述%%     百分号标记%c     字符及其ASCII码%s     字符串%d     有符号整数(十进制)%u     无符号整数(十进制)%o     无符号整数(八进制)%x ...

  3. SQL Server占用服务器内存过高

    SQL Server对服务器内存的使用策略是用多少内存就占用多少内存,只用在服务器内存不足时,才会释放一点占用的内存,所以SQL Server 服务器内存往往会占用很高. 查看内存状态: DBCC M ...

  4. mysql更新(四) 数据类型

    07-数据类型   介绍 存储引擎决定了表的类型,而表内存放的数据也要有不同的类型,每种数据类型都有自己的宽度,但宽度是可选的 详细参考链接:http://www.runoob.com/mysql/m ...

  5. python写个御剑

    前言: 今天师傅叫我,写个python版的御剑.然后我之前也写过 不过不怎么样,这次有新想法. 思路: 御剑:读取御剑配置文件里的所有路径,加上用户要扫描的url.进行批量检测,如果状态码为200并且 ...

  6. char数据类型,编程能用的最小数据类型.

    关于数据类型, char占1bit,8bites. signed代表有符号,包括正负数,和0; unsigned代表无符号,只包括0和整数; signed和unsigned的主要区别就是它们的最高位是 ...

  7. FireFox 火狐主页被劫持

    火狐主页被劫持hao123,流氓 WIN7 ,firefox,任务栏,快速启动,右键 属性 target 应该是 "D:\Program Files (x86)\Mozilla Firefo ...

  8. 机器学习入门-线性判别分析(LDA)1.LabelEncoder(进行标签的数字映射) 2.LinearDiscriminantAnalysis (sklearn的LDA模块)

    1.from sklearn.processing import LabelEncoder 进行标签的代码编译 首先需要通过model.fit 进行预编译,然后使用transform进行实际编译 2. ...

  9. Window Mysql 5.7.18安装

    1:下载地址 https://dev.mysql.com/downloads/mysql/ 点击Community , 然后点击Community Server 位置, 下载 安装包 2: 配置环境变 ...

  10. Hadoop 执行 hdfs 命令烦人的警告信息

    问题描述: 安装完 hadoop,执行 hdfs dfs -ls 命令时,报警告如下: -- ::, WARN util.NativeCodeLoader: Unable to load native ...