I was used nginx and php-fpm in ubuntu, and I had edited the files like following: /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/test/public/;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass 127.0.0.1:9999;
fastcgi_index index.php;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fixes timeouts
fastcgi_read_timeout 600;
include fastcgi_params;
}
}
/etc/php/7.1/fpm/pool.d/www.conf
listen = 127.0.0.1:9999
And I also changed the permissions like following:
chown -R www-data:www-data /usr/test/public
chmod 755 /usr/test
chmod -R 755 /usr/test/bootstrap/cache
chmod -R 755 /usr/test/AppName/storage
But when I tried to run a simple laravel project, it shows me this error message:
The stream or file "/usr/test/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
Why is that?