4
votes

Ok, I'm running an app locally as homestead.app:8000. I am running Vagrant and this only started happening after I did "vagrant halt" to change the document root for Nginx and then vagrant up.

Nginx is returning 502 Bad Gateway to the browser and the error log for my test domain states the following:

2014/05/18 21:37:11 [crit] 1368#0: *7 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 10.0.2.2, server: homestead.app, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "homestead.app:8000"

2
Does this exist /var/run/php5-fpm.sock ?Tan Hong Tat
No it doesn't exist but I didn't delete it.sparecycle
Try starting your PHP?Tan Hong Tat
You don't delete it - it's a unix socket, which (since it's *nix), you can access as a path, but it's really an open socket to php-fpm. Best advice if your services were all setup before you made a basic config change: "Have you tried turning it off and on again?" If that doesn't work, debugging this via stackoverflow could take a while. Better put on a kettle.Josh from Qaribou
I restarted using /etc/init.d/php5-fpm restart as I am running Ubuntu 14.04.sparecycle

2 Answers

1
votes

Make sure php-fpm is running. I had similar issue so at the end I changed default php-fpm port from 9000 to 8999 and kicked out socket info from nginx.conf file (replaced with host and port number). In my case this was working:

location ~ \.php {
        fastcgi_pass 127.0.0.1:8999;
        fastcgi_index /index.php;

        include /usr/local/etc/nginx/fastcgi_params;

        fastcgi_split_path_info       ^(.+\.php)(/.+)$;
        fastcgi_param PATH_INFO       $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_read_timeout 600;
    }
0
votes

Check your XAMPP Control Panel and turn off the Apache and MySQL if they are running. And run on the terminal vagrant up --provision. Works for me