learnwhat
learnwhat

Reputation: 177

how to install nginx?

I am trying to install dotplant2 in my system and for that i need to install nginx and i followed a step that dotplant2 documentaion has provided and when i try to restart nginx as the way the documentation has explained it fails to restart and when i entered this command

sudo nginx -t

Here is the error message:

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

how can i resolve this ?

Upvotes: 2

Views: 5944

Answers (2)

learnwhat
learnwhat

Reputation: 177

I found the error, in dotpalant2 documentation it says to change

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

as below

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;
    }
}

in there

include fastcgi.conf;

but in our nginx folder there is no fastcgi.conf so we have to change as

include fastcgi_params;

then all are work nicely for ubuntu 14.04.

Upvotes: 5

Mikko
Mikko

Reputation: 11

The easiest fix is to create that missing file in the /etc/nginx/ directory...

nano /etc/nginx/fastcgi.conf

...and write this line in it:

include /etc/nginx/fastcgi_params;

Upvotes: 1

Related Questions