2015-04-06 184 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;