栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP

ubuntu14.04 +nginx+php5-fpm

PHP 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ubuntu14.04 +nginx+php5-fpm

一,安装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

    

    phpinfo();

    ?>

二 安装php

sudo apt-get install php5-fpm
sudo apt-get install php5-gd  查看php5运行进程
ps -waux 打开关闭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  改为
重新运行php进程在浏览器中输入 localhost就可以看到了原文地址:


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/229100.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号