0

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?

jimmy
  • 1,549
  • 5
  • 21
  • 38

1 Answers1

-1

try chmod -R 777 also did u generate app key for your application? if not please follow below steps on your terminal type: php artisan key:generate then add it to your .env file APP_KEY=YOUR_GENERATED_KEY

it may be hidden, do ctrl + h in your project folder to view it.

manu
  • 351
  • 2
  • 15