upgrading from magento 2.3.3 to 2.4
In cpanel > terminal, permission denied when running these commands
rm -rf var/cache/* var/view_preprocessed/* var/page_cache/* var/session/* pub/static/* chmod -R 0777 var/* pub/* generated/*
Solved! Go to Solution.
The best way is to change the ownership of project to the user you're using for ssh, then you won't face the above error.
sudo chown -R africloset:africloset projectfolder/
after changing permission you'll be able to run without sudo.
or if there are multiple users working, then create a new common user and change ownership for that common user and ask dev's to use that user.
Hope it helps !
Hello @Sheba
It's related with the user you are using to run commands, the user doesn't have enough permissions to perform these actions, you might be able to run it with sudo, just append sudo before commands like below:
sudo rm -rf var/cache/* var/view_preprocessed/* var/page_cache/* var/session/* pub/static/* sudo chmod -R 0777 var/* pub/* generated/*
Hope it helps !
Thanks Gaurav for your suggestion. Am I executing the sudo in each site's public_html directories?
How do I set the permissions in webroot? So each programmer does not have to use sudo.
Thanks again.
The best way is to change the ownership of project to the user you're using for ssh, then you won't face the above error.
sudo chown -R africloset:africloset projectfolder/
after changing permission you'll be able to run without sudo.
or if there are multiple users working, then create a new common user and change ownership for that common user and ask dev's to use that user.
Hope it helps !
Thanks again, now the issue is permission denied when running this command
/opt/cpanel/ea-php74/root/bin/php bin/magento setup:upgrade