CentOS_PHP_NGINX_FastCGI
2024-10-14 06:32:25
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
最新文章
- iOS版打地鼠游戏源码
- excel 转换日期
- 【随笔】mvc使用forms身份验证实现登陆
- Android 坐标系统
- 分析SIX锁和锁分区导致的死锁
- JavaScript系列:《JavaScript高级程序设计》,chapter2, 在html中使用JavaScript
- Ubuntu14.04 切换root账户su root失败解决办法
- ajax 本地测试,使用Chrome 浏览器
- C#_Fileuploadify_notMvc
- mapping 详解1(mapping type)
- FileUtils类介绍
- 我所理解的设计模式(C++实现)——状态模式(State Pattern)
- zTree实现地市县三级级联DAO接口测试
- HDU 1034(传递糖果 模拟)
- 关于C++ const 的全面总结 (转)
- Initialize a vector in C++ (5 different ways)
- github或码云协同开发
- 【bat/cmd】脚本开发
- transform.rotation和GetComponent<;Rigidbody>;().MoveRotation
- 记开发个人图书收藏清单小程序开发(五)Web开发
热门文章
- eclipse汉化
- ES6新特性:Javascript中的Reflect对象
- poj3294 出现次数大于n/2 的公共子串
- CodeForces 450B 矩阵
- Elasticsearch静态集群配置
- C#-WinForm-ListView-表格式展示数据、如何将数据库中的数据展示到ListView中、如何对选中的项进行修改
- java.lang.Exception: No runnable methods
- HIVE: collect_set(输出未包含在groupby的字段);
- Java多线程与并发库高级应用-传统线程互斥技术
- SCP注意事项