It is common to see errors like: “permission denied”, that you can see in your applications after uploading the code to your LinuxÂ server. You can simply change many of these errors by providing the properÂ permissions to apache running on your server.
To change the apache running user, execute the below command and open the file with vim:
sudo vim /etc/apache2/envvars
Look through the file contents and modify the lines which resemblesÂ like:
Replace the “www-data” in the first line to your username and for second line, replace with your user’s group name.
Save the file with VIM commands. For more details about VIM commands, please click here.
Restart the server by executing the following command:
sudo service apache2 restart
Now, you can see that your application will run without permission errors.
Note: The whole article is written by assuming that you uploaded all your files to a user owned folder.