If you upgraded to PHP 5.5.12 then open up /etc/php5/fpm/pool.d/www.conf and uncomment the following listen directives:
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
Run this afterwards:
sudo service php5-fpm restart
Okay, tried this, but it does not work as expected. :(
If anybody else has the same error, try to add this before the Fixing permissions
part of the bootstrap.sh file.
echo " --- Fixing 502 Bad Gateway --- "
sed -i 's/;listen.owner = www-data/listen.owner = vagrant/g' /etc/php5/fpm/pool.d/www.conf
sed -i 's/;listen.group = www-data/listen.group = vagrant/g' /etc/php5/fpm/pool.d/www.conf
sed -i 's/;listen.mode = 0660/listen.mode = 0660/g' /etc/php5/fpm/pool.d/www.conf
Well, worked for me for all our production sites and my local vagrant server. We're using Nginx 1.6 and Ubuntu 14.04, though, so might make a difference.
Okay, I will check it again. We are using nginx 1.2.1 and Debian Wheezy if I remember correctly.
Thanks!
I updated to 1.6, but it didn't work. This will:
Just change php5-fpm.sock
's owner from root
/vagrant
to www-data
like below...
chown www-data:www-data /var/run/php5-fpm.sock
@shabushabu thanks a lot! I was having the same issue and this solved it perfectly.
I also found that comments were breaking my code causing 502 errors. I was accidentally breaking comments with @includes, by mixing comments.
I met the same issue. I found a solution to ignore the error.
Adding two lines to Nginx configuration file /etc/nginx/nginx.conf :
http {
...
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
...
}
i just got the same error as the thread owner, the fix i did was to open my virtualbox app (mac) and just REMOVE it and clear it all, and then just did a vagrant up and now it works again
and if you are using laravel its easy to migrate your database again
I agree with SimonJ. Delete the lot and start again. It was quick, easy and fixed the problem. I wish I'd read this thread earlier instead of trying to "fix" the problem and getting nowhere.
What I did was..... Upgrade to latest VirtualBox (4.3.16 for me) Select your virtual Machine from the list "VirtualBox/Machine/Close/Power Off", then "VirtualBox/Machine/Remove [+"Delete All files" option]" then "Close VirtualBox"
From the Terminal..... CD to your Homestead folder (for me "cd WWWBOX/VirtualBoxVM/homestead") then "Vagrant up"
Thats all there is to it. Just let Vagrant rebuild the virtual machine and you are good to go.
This will not affect any of your "Settings" as these are all contained in your Homestead.yaml file. Everything that worked before will spring into life again.
Good luck
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community