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. 跟我一起学习ASP.NET 4.5 MVC4.0(六)

    这一系列文章跨度有点大,由于最近忙于其他事情,没有更新,今天重新安装了下Win8系统,VS2012和SQLServer 2012,顺便抽空继续一篇.随着VS2012 RC版本的放出,ASP.NET M ...

  2. npm install mysql --save-dev

    npm install X: 会把X包安装到node_modules目录中 不会修改package.json 之后运行npm install命令时,不会自动安装X npm install X –sav ...

  3. Apache自带性能测试工具ab的使用

    Apache服务器套件自带ab,只要安装Apache即可,无需另行安装ab.ab位于%ApacheHome%/bin目录下(“%ApacheHome%”为Aapche安装路径),你也可以把ab.exe ...

  4. jq 的onchange事件

    按商品类型显示:<select onchange="location.href='__ACTION__/type_id/'+this.value;">    <o ...

  5. Python mode_w

    # 每次使用w模式打开文件, 都会清空这个文件(坑) f = open("胡辣汤",mode="w",encoding="utf-8") f ...

  6. centos7系统初始化

    echo "# swappiness=0的时候表示最大限度使用物理内存,然后才是 swap空间" >> /etc/sysctl.conf echo -e "v ...

  7. 使用Ant搭建Android开发环境入门

    使用Ant搭建Android开发环境入门   使用Ant搭建Android开发环境,建立android项目 配置Ant环境 下载Ant:http://ant.apache.org/bindownloa ...

  8. Texas Instruments matrix-gui-2.0 hacking -- menubar.php

    <?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...

  9. Linux下你需要了解的10个网络和监控命令

    我下面列出来的10个基础的每个linux用户都应该知道的网络和监控命令.网络和监控命令类似于这些: hostname, ping, ifconfig, iwconfig, netstat, nsloo ...

  10. 数据库备份-SQL Server 维护计划

    SQL Server 维护计划(数据库备份)   公司的项目都需要定期备份,程序备份关掉iis站点复制文件就可以了,难受的地方就是数据库的备份了.服务器上装的大都是英文版,一看见英文,操作都变得小心翼 ...