Set File or Directory Ownership
Set the ownership of your project directory and all directories/files in it to your root user and set the group to the webserver.
Run this commands:
sudo chown -R your-user-name:www-data /path/to/your/application;
Now cd /path/to/your/application
indo the project root and run below command:
sudo chown -R www-data storage vendor bootstrap/cache storage/app/public/images;
Warning: Here the
your-user-name
is your username and the web server is running as www-data
as most servers do. The /path/to/your/application
is the project path. Replace the values with yours.