Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Dan-Thomas Tveita
Dan-Thomas Tveita
107 Points

Homestead nginx Bad Gateway 502

Im trying to run homestead as a "Per project installation" like in the official documentation https://laravel.com/docs/5.1/homestead#per-project-installation

After vagrant provision I get a

default: php7.0-fpm: unrecognized service The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong.

What does this mean?

After a typical Homestead.yaml config ( mydomain.app), visiting mydomain.app gives me a nginx: Bad gateway 502.

Nginx errorlog says

unix:/var/run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, client:

When doing a php -v it says php5. Im a little confused to what is happening here.

Any ideas?