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 command:
sudo chown -R your-user-name:www-data /path/to/your/application
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.