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. webService访问加密-Soapheader

    WebService head加密,可以对 WebService设置访问用户名和密码,增强 WebService的安全性 使 WebService只能被授权用户使用. 具体实现步骤: 1. 定义一个  ...

  2. 关于ExtJS、JQuery UI和easy UI的选择问题

    转自百度知道. 问:做企业级应用,比如***管理系统,不需要华丽的特效,只希望简单,风格统一.能用到的只有messagebox.tree.grid大概这几个,其他特效不要,忘大神根据自己的见解以及我这 ...

  3. poj1966 求顶点连通度

    Cable TV Network Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 4563   Accepted: 2118 ...

  4. window 系统设置无线wifi

    netsh wlan set hostednetwork mode=allow ssid=huage key=243573295 如上表示设置成功 然后继续输入 netsh wlan start ho ...

  5. jsp动态include和静态Include

    动态 INCLUDE 用 jsp:include 动作实现 <jsp:include page="included.jsp" flush="true" / ...

  6. vim快捷键总结

    直接上图 原图地址:vim快捷键

  7. AS技巧合集「编码技巧篇」

    转载:http://www.apkbus.com/forum.php?mod=viewthread&tid=254725&extra=page%3D2%26filter%3Dautho ...

  8. Leetcode 98. Validate Binary Search Tree

    Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as ...

  9. 【BZOJ-3931】网络吞吐量 最短路 + 最大流

    3931: [CQOI2015]网络吞吐量 Time Limit: 10 Sec  Memory Limit: 512 MBSubmit: 1228  Solved: 524[Submit][Stat ...

  10. 【BZOJ-3437】小P的牧场 DP + 斜率优化

    3437: 小P的牧场 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 705  Solved: 404[Submit][Status][Discuss ...