1   . 安装php7     
下载地址:https://secure.php.net/downloads.php
这里下载的是:wget http://ar2.php.net/distributions/php-7.0.6.tar.gz
下载之后解压并进入在解压文件中
安装:./configure  -enable-fpm --with-pdo-mysql --with-mysql --with-mysqli --with-curl --with-openssl --enable-mbstring(enable-fpm参数即可开启PHP-FPM)  ->  make && make install
(PHP在 5.3.3 之后已经讲php-fpm写入php源码核心了)

2  . nginx整合php-fpm

. 启动php-fpm: /usr/local/sbin/php-fpm

报错
[18-May-2016 18:07:58] ERROR: failed to open configuration file '/usr/local/etc/php-fpm.conf': No such file or directory (2)
[18-May-2016 18:07:58] ERROR: failed to load configuration file '/usr/local/etc/php-fpm.conf'
[18-May-2016 18:07:58] ERROR: FPM initialization failed

到/usr/local/etc/目录下,将php-fpm.conf.default拷贝一份成php-fpm.conf

3 . 安装nginx

Nginx 一般有两个版本,分别是稳定版和开发版,您可以根据您的目的来选择这两个版本的其中一个,下面是把 Nginx 安装到 /usr/local目录下的详细步骤:

wget http://nginx.org/download/nginx-1.4.2.tar.gz

tar -zxvf nginx-1.4.2.tar.gz

cd nginx-1.4.2

./configure

make

make install

4 THINK3.2.3 的配置

修改nginx的配置文件

#user  nobody;
worker_processes ; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout ;
keepalive_timeout ; #gzip on; server {
listen ;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root html;
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$ last;
break;
}
} error_page /.html;
location = /.html {
return 'Sorry, File not Found!';
}
# redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
# location ~ \.php/?.*$ {
root html;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
include fastcgi_params;
set $fastcgi_script_name2 $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") {
set $fastcgi_script_name2 $;
set $path_info $;
}
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2;
fastcgi_param SCRIPT_NAME $fastcgi_script_name2;
} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen ;
# listen somename:;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }

centos1.7 配置nginx+php+mysql客户端+thinkphp的rewrite实现的更多相关文章

  1. [原创]Centos7 从零配置Nginx+PHP+MySql

    序言 这次玩次狠得.除了编译器使用yum安装,其他全部手动编译.哼~ 看似就Nginx.PHP.MySql三个东东,但是它们太尼玛依赖别人了. 没办法,想用它们就得老老实实给它们提供想要的东西. 首先 ...

  2. windows7配置Nginx+php+mysql教程

    windows7配置Nginx+php+mysql教程 最近在学习php,想把自己的学习经历记录下来,并写一些经验,仅供参考交流.此文适合那些刚刚接触php,想要学习并想要自己搭建Nginx+php+ ...

  3. windows7配置Nginx+php+mysql的详细教程

    windows7配置Nginx+php+mysql的详细教程 作者:Vincent.李 字体:[增加 减小] 类型:转载 时间:2016-09-04我要评论 这篇文章主要介绍了windows7配置Ng ...

  4. virtualBox安装centos7并配置nginx php mysql运行环境

    virtualBox安装centos7并配置nginx php mysql运行环境 一:virtualBox安装centos7并进行基础设置 1.下载dvd.iso安装文件,下载地址:https:// ...

  5. nginx + php +mysql (适配thinkphp)

    Nginx 单机配置 http://tengine.taobao.org/book/index.html (taobao book) http://ubuntuhandbook.org/index.p ...

  6. docker完整配置nginx+php+mysql

    首先了解一个方法: 使用docker exec进入Docker容器 docker在1.3.X版本之后还提供了一个新的命令exec用于进入容器,这种方式相对更简单一些,下面我们来看一下该命令的使用: s ...

  7. Cubieboard A10 安装Nand系统,配置nginx,php,mysql,samba详细教程

    安装前置条件 1.下载win32diskimager-v0.7-binary.zip 2.下载debian_wheezy_armhf_v1_mele.zip 3.下载cubie_nand_uboot_ ...

  8. 在ubuntu上配置nginx+php+mysql+phpmyadmin

    1.先更新ubuntu系统 更新命令 sudo apt-get update sudo apt-get upgrade 2 添加ubuntu nginx更新源镜像 cd /etc/apt/ sudo ...

  9. CentOS6.3上安装与配置nginx+php+mysql环境

    1. 目前nginx采用是源码包安装的方式(yum安装失败),下载地址:http://nginx.org/en/download.html 我这里的安装包是:nginx-1.12.0.tar.gz 2 ...

随机推荐

  1. TListBox的项目个数

    function TCustomListBox.GetCount: Integer; begin if Style in [lbVirtual, lbVirtualOwnerDraw] then Re ...

  2. 所谓的规范以及JDK api文档的重要性

    所谓的规范,就是在jee api 文档里对应的接口. 可以从jdk文档和jee文档的目录结构,接口中获取对整个编程范围的把握

  3. http请求报头

    客户请求的处理:Http请求报头 创建高效servlet的关键之一,就是要了解如何操纵超文本传输协议(HypeText TransferProtocol, HTTP). HTTP请求报头不同于前一章的 ...

  4. bjui的ajax form不使用validate的表单验证

    当form使用data-toggle为ajaxform或者是validate的时候,表单的onSubmit()和submit按钮的click()事件明明return false:还是会提交. 如果将d ...

  5. spring核心容器

    容器:用来包装或装载物品的储存器 web服务器与jsp.servlet的关系: 从程序文件存放的位置 程序文件要放到web服务器上 从程序执行的方式  程序的从初始化到消亡都是web服务器管理的 从以 ...

  6. php session和cookie知识

  7. Python mode_a

    f = open("葫芦小金刚", mode="a", encoding="utf-8") # a, append 追加, 在文件的末尾写入 ...

  8. XCODE中使用Main.Storyboard拉入控件并实现事件(Swift语言)

    如何在XCODE中的Main.Storyboard内拉入控件并实现一个简单的效果呢?本人由于刚接触Swift语言不久,对于IDE的操作还是很生疏,不懂了就在网上参考了网上前辈们的文章.以下我将演示如何 ...

  9. Swift 编程语言入门教程

    1   简介 今天凌晨Apple刚刚发布了Swift编程语言,本文从其发布的书籍<The Swift Programming Language>中摘录和提取而成.希望对各位的iOS& ...

  10. 使用Nginx实现灰度发

     灰度发布是指在黑与白之间,能够平滑过渡的一种发布方式.AB test就是一种灰度发布方式,让一部分用户继续用A,一部分用户开始用B,如果用户对B没有什么反对意见,那么逐步扩大范围,把所有用户都迁移到 ...