Hi Guys, I’ve been trying to install laravel 5.1 with Nginx, I’ve installed the php-fpm, is currently running on /var/run/php5-fpm.sock.
I’ve created my nginx config as follow:
server {
listen 80;
server_name api.mydomain.com;
root /var/www/api.mydomain.com/current/public/;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
However… when I try access my site I’m getting this error:
2016/02/11 16:25:04 [crit] 6465#0: *48 connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream, client: XXX.XXX.XXX.XXX, server: api.mydomain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "api.mydomain.com"
Seems like is a problem with user permissions, can anyone help?
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Run 2 the following command: chown -R www-data:www-data /path/to/laravel/public/forder
chmod +x /var/run/php5-fpm.sock
If you see 502 Bad GateWay error, open /etc/nginx/nginx.conf, at the top of file edit user to www-data, if don’t exist add this line to top of file user www-data; Save and reload Nginx: nginx -s reload Your Laravel Framework should be run
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.