Get error when running a laravel app in ubuntu

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Get error when running a laravel app in ubuntu



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?





stackoverflow.com/questions/30639174/… you can refer here permission things
– San K
Aug 8 at 7:54





Just chmod -R 755 /usr/test/storage
– kerbholz
Aug 8 at 7:55


chmod -R 755 /usr/test/storage





@SanK ok, let me take a look
– jimmy
Aug 8 at 8:00





@kerbholz I tried, but still got the same error.
– jimmy
Aug 8 at 8:01





@kerbholz How, it works! I tried chown -R www-data:www-data /usr/test , thanks man!
– jimmy
Aug 8 at 8:09




1 Answer
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


chmod -R 777


php artisan key:generate



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






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered