2015-04-06 61 views
2

我试图在我的系统中安装dotplant2,为此我需要安装nginx,然后我按照文档提供的dotplant2提供的步骤以及当我尝试重新启动nginx时,文档解释为无法重新启动,并且当我输入此命令如何安装nginx?

sudo nginx -t 

以下是错误消息:

nginx:[emerg] open() "/etc/nginx/fastcgi.conf" failed (2: No such file or directory) 
in /etc/nginx/sites-enabled/dotplant2-host:20 

我怎样才能解决这个问题?

回答

4

我发现错误,dotpalant2文档中,它说在那里

include fastcgi.conf;

但在我们的nginx文件夹中更改

/etc/nginx/sites-enabled/dotplant2-host

如下

server { 
    listen 80; 

    # NOTE: Replace with your path here 
    root /home/user/dotplant2/application/web; 
    index index.php; 

    # NOTE: Replace with your hostname 
    server_name dotplant2.dev; 

    location/{ 
     try_files $uri $uri/ /index.php?$args; 
    } 

    location ~ \.php$ { 
     try_files $uri =404; 
     fastcgi_split_path_info ^(.+\.php)(/.+)$; 
     fastcgi_pass unix:/var/run/php5-fpm.sock; 
     fastcgi_index index.php; 
     include fastcgi.conf; 
    } 

    location ~ /\.ht { 
     deny all; 
    } 
} 

没有fastcgi.conf所以我们必须改变,因为

include fastcgi_params;

然后所有人都为Ubuntu 14.04很好地工作。

0

最简单的解决方法是创建在/ etc/nginx的/目录中丢失的文件...

nano /etc/nginx/fastcgi.conf

...并在此线在它:

include /etc/nginx/fastcgi_params;