打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
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
    <? 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

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
深度 linux 搭建 php 开发环境
ubuntu18.04上已有java环境下如何安装php服务(多版本)
ubuntu安装PHP7.0以及memcache,redis等常用扩展
如何从php5升级到php7,ubuntu 14 ,nginx+php7
Couldn't find package php5-fpm
wordpress国内网速慢加速及防DDOS攻击快速CF切换教程
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服