2

I've seen a bunch of questions about this problem on here but none of those had answers that helped me out.

I kept getting a 502 error from nginx so I took a look at the access.log and saw I kept getting error 111 when the server tried to connect to unix:/var/run/php5-fpm.sock

I've restarted php5-fpm and made sure that the socket is actually there but I keep getting this error.

Do you guys know why?

My nginx.conf

user www-data www-data;
worker_processes auto;
error_log /var/log/nginx_error.log;
pid /run/nginx.pid;

events {
  worker_connections 1024;
}

http {

  include /etc/nginx/mime.types;
  default_type application/octet-stream;

  sendfile on;
  tcp_nopush on;
  tcp_nodelay on;
  keepalive_timeout 65;
  types_hash_max_size 2048;

  fastcgi_buffers 8 16k;
  fastcgi_buffer_size 32k;
  gzip on;
  gzip_disable "msie6";

  access_log /var/logs/nginx/access.log;
  error_log /var/logs/nginx/access.log;

  server {
    listen 80 default_server;

    root /var/www/app/public/;
    index index.php index.html index.htm =404;

    server_name localhost;

    charset utf-8;

    location / {
      try_files $uri $uri/ /index.php?$query_string =404;
    }

    location ~ \.php$ {
      try_files $uri /index.php =404;
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      fastcgi_pass unix:/var/run/php5-fpm.sock;
      fastcgi_index index.php;
      #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params;
    }

  }
}

and the php-fpm.conf here

benbot
  • 121
  • 3

1 Answers1

0

php5-fpm uses SCRIPT_FILENAME to find the path to the php file to interpret. I notice that you have that line commented out. Is that an oversight or has that line been moved to the fastcgi_params include file?

Richard Smith
  • 12,834
  • 2
  • 21
  • 29