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;
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-nameis your username and the web server is running as
www-dataas most servers do. The
/path/to/your/applicationis the project path. Replace the values with yours.