/*************************************************************************
* CentOS 6.6 nginx PHP 配置
* 说明:
* 在VPS上安装nginx PHP配置,以供有些时候无聊使用。
*
* 2016-11-26 深圳 南山平山村 曾剑锋
************************************************************************/ 一、参考文档:
. CentOS 6.5 yum安装配置lnmp服务器(Nginx+PHP+MySQL)
http://blog.csdn.net/lane_l/article/details/20235909
. PHP-FPM does not automatically start after reboot
http://serverfault.com/questions/459728/php-fpm-does-not-automatically-start-after-reboot
. OpenBSD.Nginx.MySQL.PHP环境搭建手册
http://www.360doc.com/content/10/1211/11/4330887_77027995.shtml 二、安装:
yum install php
yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel php-fpm 三、测试php-cgi:
php-cgi -b 127.0.0.1: 四、后台运行php-cgi:
. /etc/rc.d/init.d/php-fpm start
. chkconfig php-fpm on 五、nginx配置:
[root@localhost /]# cat /etc/nginx/conf.d/php.conf
server {
listen ;
server_name localhost; #charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main; location / {
root /home/zengjf/www;
index index.php index.html index.htm;
} #error_page /.html; # redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root /usr/share/nginx/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 /home/zengjf/www;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
[root@localhost /]#

CentOS 6.6 nginx PHP 配置的更多相关文章

  1. CentOS 下 安装 nginx 执行配置命令 ./configure 报错

    CentOS 下 安装 nginx 执行配置命令 ./configure --prefix=/opt/nginx --sbin-path=/usr/bin/nginx 时提示以下错误: checkin ...

  2. CentOS 7 安装Nginx 并配置自动启动

    1.官网下载安装包 http://nginx.org/en/download.html,选择适合Linux的版本,这里选择最新的版本,下载到本地后上传到服务器或者centos下直接wget命令下载. ...

  3. Centos 6.3 nginx代理配置

    1. 查看nginx所在位置 $ nginx -t /etc/nginx/nginx.conf 2. 配置 user  nobody; #启动服务的用户 worker_processes  ; err ...

  4. Ubuntu/CentOS 系统上安装与配置Nginx

    一.在线安装: Ubuntu:sudo apt-get install nginx CentOS: sudo yum install nginx 二.安装后的位置: 1.服务地址:/etc/init. ...

  5. CentOS mini 和 nginx 的安装和配置要点

    1.安装VMware Player    版本:5.0.2 build-1031769 2.安装XShell    版本:Build 0126 3.安装CentOS    版本:6.4-x86_64- ...

  6. CentOS 7 安装 Nginx 配置反向代理

    Linux使用Nginx Yum存储库上安装Nginx,适用于Red Hat Enterprise Linux和CentOS系统. 1.添加设置Nginx Yum存储库 在CentOS中首次安装Ngi ...

  7. CentOS 8 下 nginx 服务器安装及配置笔记

    参考文档 nginx官方文档 安装 在CentOS下,nginx官方提供了安装包可以安装 首先先安装前置软件 sudo yum install yum-utils 然后将nginx官方源加入到yum源 ...

  8. CentOS 6.5 Nginx 配置

    1.安装所有 http功能: ./configure --user=www-data --group=www-data --with-http_ssl_module --with-http_reali ...

  9. 从零开始学 Java - CentOS 下 Nginx + Tomcat 配置负载均衡

    为什么现在有非常多的聪明人都在致力于互联网? 最近在读埃隆·马斯克传记,他说「我认为现在有非常多的聪明人都在致力于互联网」. 仔细一想,好像真的是这样的. 我问了自己一个问题:如果你不敲代码了,你能做 ...

随机推荐

  1. Javascript 严格模式详解(转)

    一.概述 除了正常运行模式,ECMAscript 5添加了第二种运行模式:"严格模式"(strict mode).顾名思义,这种模式使得Javascript在更严格的条件下运行. ...

  2. 用js实现返回上一页

    <a href="javascript :;" onClick="javascript :history.back(-1);">返回上一页</ ...

  3. httpClient 4.x post get方法

    public static String doPost(String url, String encoding, String contentType, String sendData) throws ...

  4. 二分图 最大权匹配 km算法

    这个算法的本质还是不断的找增广路: KM算法的正确性基于以下定理:若由二分图中所有满足A[i]+B[j]=w[i,j]的边(i,j)构成的子图(称做相等子图)有完备匹配,那么这个完备匹配就是二分图的最 ...

  5. CentOS 7.2 安装教程

    1.CentOS 7.2 下载 下载地址: http://www.centoscn.com/CentosSoft/iso/2016/0601/7341.html 下载:CentOS-7-x86_64- ...

  6. plsql记住登录密码

    登录plsql:tools(工具)->preference(首选项)->Login history(登录历史):选择"Store with password"(带口令存 ...

  7. Socket通信(转)

    一.Socket通信简介 Android与服务器的通信方式主要有两种,一是Http通信,一是Socket通信.两者的最大差异在于,http连接使用的是“请求—响应方式”,即在请求时建立连接通道,当客户 ...

  8. L1 - 闭包和原型链

    先来一炮尝尝: var i = 10; function myFunc(){ var i = 20; function innerFunc(){ alert(i); } return innerFun ...

  9. 集成自动化的条形码功能到internet应用程序,网站或自定义Java应用程序的条码控件Java Barcode Package

    Java Barcode Package控件是一款条码生成控件,包含所有的JavaBean,Applets,Servlets和类库可以使用于装有Java虚拟机的任何平台,包括Windows®, Lin ...

  10. java面试题之ssh

    1.写出你熟悉的开源框架以及各自的作用(项目中为什么使用SSH) 答:框架:hibernate,spring,struts1/struts2. Hibernate主要用于数据持久化:封装了JDBC操作 ...