yum安装nginx,它会默认作为一个服务加到系统中,启动nginx:

service nginx start/nginx -s start

他有4个参数(start|stop|restart|reload)
 
安装PHP及重要插件php-fpm:

yum install php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-fpm php-mbstring

yum install epel-release //扩展包更新包
yum  update //更新yum源
yum install php-mcrypt

这个时候php就安装完成拉,写个脚本测试一下
 

vi /usr/share/nginx/html/info.php

输入
 
<?php
phpinfo();
?>
 
修改nginx配置加载PHP:

vi /etc/nginx/conf.d/default.conf

location ~ \.php$ {
       root           /usr/share/nginx/html;
       fastcgi_pass   127.0.0.1:9000;
       fastcgi_index  index.php;
       fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
       include        fastcgi_params;
}
 
配置 /etc/php-fpm.d/www.conf:
 
找到并取消注释,设置成你希望管理 www 应用的用户(我这里统一用用户 theflash)
listen.owner = theflash
listen.group = theflash
 

更换目录所有者:

chown theflash:theflash /data/wwwroot -R

启动FastCGI形式的PHP:

service php-fpm start(start|stop|restart)

启动MySQL:

service mysqld start(start|stop|restart|reload)

 
设置这三个服务自动启动:
chkconfig nginx on
chkconfig php-fpm on
chkconfig mysqld on
 

CentOS_PHP_NGINX_FastCGI的更多相关文章

随机推荐

  1. python之旅3

    1 collections系列 方法如下 class Counter(dict): '''Dict subclass for counting hashable items. Sometimes ca ...

  2. 通过lucene的StandardAnalyzer分析器来了解分词

    本文转载http://blog.csdn.net/jspamd/article/details/8194919 不同的Lucene分析器Analyzer,它对TokenStream进行分词的方法是不同 ...

  3. bzoj 1588 splay模板题

    用晚自习学了一下splay模板,没想象中那么难,主要是左旋和右旋可以简化到一个函数里边,减少代码长度... #include<iostream> #include<cstdio> ...

  4. 【bzoj3218】 a + b Problem

    http://www.lydsy.com/JudgeOnline/problem.php?id=3218 (题目链接) 题意 给${n}$个格子涂白或黑色,白则${w_i}$,黑则${b_i}$的好看 ...

  5. 何解決 LinqToExcel 發生「無法載入檔案或組件」問題何解決 LinqToExcel 發生「無法載入檔案或組件」問題

    在自己的主機上透過 Visual Studio 2013 與 IISExpress 開發與測試都還正常,但只要部署到測試機或正式機,就是沒辦法順利執行,卡關許久之後找我協助.我發現錯誤訊息確實很「一般 ...

  6. BZOJ1049 [HAOI2006]数字序列0

    本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000作者博客:http://www.cnblogs.com/ljh2000-jump/转 ...

  7. D1

    第一天

  8. ListView优化-ViewHolder的优化备份

    ViewHolder.java package cn.edu.bzu.util; import android.content.Context; import android.util.SparseA ...

  9. Flipping Bits in Memory Without Accessing Them: An Experimental Study of DRAM Disturbance Errors

    目录 . Rowhammer Introduction . Rowhammer Principle . Track And Fix 1.  rowhammer introduction 今天的DRAM ...

  10. scala中集合的交集、并集、差集

    scala中有一些api设计的很人性化,集合的这几个操作是个代表: 交集: scala> Set(1,2,3) & Set(2,4) // &方法等同于interset方法 sc ...