Question

How to install Laravel 5 on Ubuntu/Nginx server

Hi,

I have been trying to get Laravel 5 installed in my Ubuntu/Nginx server but not luck. I followed this tutorial but I keep getting the following error “502 Bad Gateway nginx/1.4.6 (Ubuntu)”.

Any idea what could be happening here? Have any one see this error after following this tutorial tutorial?

Is there any other tutorial that I could follow to install Laravel 5?

Thanks

Subscribe
Share

Check if php5fpm process exist :

sudo ps aux | grep php5

Would it possible to paste your nginx config here. you can replace domain and sensitive info first

Seams that something is wrong with the php-fpm service.

Check your nginx and php-fpm logs.

tail -f /var/log/nginx/* /var/log/php*

This article should help you more.

I ran into a similar issue that was solved by fixing my permissions and nginx.conf file.

This guide helped me alot: http://laravel-recipes.com/recipes/26/creating-a-nginx-virtualhost

Here is what I got running sudo vi /var/log/nginx/error.log

2015/05/28 15:12:01 [crit] 13205#0: *72 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 888.888.888.88, server: mydomain.com, request: “GET / HTTP/1.1”, upstream: " fastcgi://unix:/var/run/php5-fpm.sock:", host: “mydomain.com

Thanks

Any suggestion? I don’t want to give up that easy.

This is what I got when I typed sudo ps aux | grep php5

root	  11842  0.0  1.4  79088  7524 ?        Ss   May27   0:04 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
username  13085  0.0  0.1  11740   932 pts/0    S+   07:27   0:00 grep --color=auto php5

I hope non of this info compromises my server.

Thanks

Thank you for your reply.

Here is what I get when I run sudo tail -f /var/log/php*

[27-May-2015 07:38:19] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

And here is what I get when I run sudo tail -f /var/log/nginx/* tail: cannot open ‘/var/log/nginx/*’ for reading: No such file or director

This is what I see when I open sudo vi /var/log/nginx/

access.log
access.log.1
error.log
error.log.1
.swp

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Problem solved, added user www-data; to file sudo vi /etc/nginx/nginx.conf and it did the trick.