0
votes

I would like to make the configuration what mentioned in the subject. If I start the nginx I see this error message in /var/log/nginx/error.log

*1 connect() to unix:127.0.0.1:9000 failed (2: No such file or directory) while connecting to upstream

I tried to set with socket. I get the following error

unix:/var/run/php5-fpm.sock failed (2: No such file or directory)

Seems the nginx need a file or not the path is bad. Exactly I not understand how can I solve it,

Here is my nginx settings

location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params; }

when I tried with socket I used this ( fastcgi_pass unix:/var/run/php-fpm/php5-fpm.sock;)

I change in /etc/php-fpm/www.conf only the "listen" attribute depends on fastcgi_pass.

Anyone has an idea how can I solve it?

Update: I changed fastcgi_pass unix:127.0.0.1:9000 to fastcgi_pass 127.0.0.1:9000 In this case I got the following error

*1 connect() failed (111: Connection refused) while connecting to upstream,

And the following messages when I started the php-fpm

Oct 17 09:30:31 raspi php-fpm[6605]: [17-Oct-2013 09:30:31] ALERT: [pool www] user has not been defined
Oct 17 09:30:31 raspi php-fpm[6605]: [17-Oct-2013 09:30:31] ERROR: failed to post process the configuration
Oct 17 09:30:31 raspi php-fpm[6605]: [17-Oct-2013 09:30:31] ERROR: FPM initialization failed
Oct 17 09:30:31 raspi systemd[1]: php-fpm.service: main process exited, code=exited, status=78/n/a
Oct 17 09:30:31 raspi systemd[1]: Unit php-fpm.service entered failed state
1

1 Answers

-1
votes

Solved

I had to set the following users in the php-fpm

user group listen.owner listen.group