ubuntu14.04 +nginx+php5-fpm
来源:互联网 发布:淘宝上有名的女装店 编辑:程序博客网 时间:2024/05/16 12:53
http://www.cnblogs.com/Bonker/p/4252588.html
一,安装Nginx
apt-get install nginx
1,配置nginx
nginx所有的配置在 /etc/nginx/nginx.conf中
nginx.conf配置里面包括了
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
这两个配置,所以这里面的配置也是有效的。
错误日志 error_log /var/log/nginx/error.log;
这里我们把配置写在 /etc/nginx/sites-available/default中
修改 root /usr/share/nginx/html; 这是网页的根目录,默认里面有一个index.html页面
index index.html index.htm修改成index index.php index.html index.htm;
增加
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
2,保存文件,使配置生效 /etc/init.d/nginx reload
3,启动nginx
/etc/init.d/nginx start
4,在 /usr/share/nginx/html下新建index.php
<? php
phpinfo();
?>
二 安装php
sudo apt-get install php5-fpm
sudo apt-get install php5-gd # Popular image manipulation library; used extensively by Wordpress and it's plugins.sudo apt-get install php5-cli # Makes the php5 command available to the terminal for php5 scriptingsudo apt-get install php5-curl # Allows curl (file downloading tool) to be called from PHP5sudo apt-get install php5-mcrypt # Provides encryption algorithms to PHP scriptssudo apt-get install php5-mysql # Allows PHP5 scripts to talk to a MySQL Databasesudo apt-get install php5-readline # Allows PHP5 scripts to use the readline function查看php5运行进程
ps -waux | grep php5打开关闭php5进程
sudo service php5-fpm stopsudo service php5-fpm startsudo service php5-fpm restartsudo service php5-fpm status配置php5监听端口 /etc/php5/fpm/pool.d/www.conf把
listen = /var/run/php5-fpm.sock 改为
listen = 127.0.0.1:9000
重新运行php进程在浏览器中输入 localhost就可以看到了
0 0
- ubuntu14.04 +nginx+php5-fpm
- ubuntu14.04 +nginx+php5-fpm
- ubuntu14.04 +nginx+php5-fpm
- ubuntu14.04 环境下安装配置nginx+php5-fpm
- Ubuntu14.04 配置nginx 与 php-fpm
- ubuntu14.04 安装nginx和php5.6.12
- Nginx+Php5-fpm在Ubuntu10.04中的安装配置方法
- nginx+php5-fpm在ubuntu10.04中的安装配置方法
- ubuntu12.04 安装Nginx+PHP5(PHP-FPM) +MySQL主机详解
- Ubuntu 下安装 Nginx ( Nginx + Php5-fpm )
- Ubuntu 下安装 Nginx ( Nginx + Php5-fpm )
- Nginx + FastCgi/ php5-fpm + nginx_http_push_module安装
- nginx + php5-fpm 无法正常启动一则
- Ubuntu 14.04 部署Phabricator + Nginx + php5-fpm
- ubuntu14.04 LEMP(linux+nginx+mysql+php5)构建环境
- Ubuntu14.04 下安装配置php5和nginx问题解决
- ubuntu14.04 LEMP(linux+nginx+mysql+php5)构建环境
- ubuntu14.04 LEMP(linux+nginx+mysql+php5)构建环境
- java获取客户端ip地址
- 2014 xi'an Problem F. Color (Gym 100548F) 容斥原理
- Apktool 源码分析
- 51Nod-1605-棋盘问题
- C Primer Plus学习 五 研究和利用printf ()和scanf ()
- ubuntu14.04 +nginx+php5-fpm
- POJ2836-Rectangular Covering-状态dp
- Java序列化对象的存储和读取
- How to create AK in PowerDesigner
- UVA 11078 Open Credit System(空间优化+时间优化)
- POJ ACM训练指南
- 要使用CocoaPods下载安装CocoaPods
- Android studio报:Caused by: java.lang.ClassNotFoundException: Didn't find class "xhs.com.view.ParentV
- ITK在写图像文件时发生异常的解决方法