From Just another day in the life of a linux sysadmin
Jump to navigation Jump to search

Magento installs and CPanel

php-cli -f /home/USER/public_html/bin/magento deploy:mode:set production

Once things were run with php-cli instead of PHP I was able to see this complete fully and was then able to load the Admin area properly.

When installing a new magento ensure you do so as the user su - {cpanel username}

For the magento command deployments or other execution ensure you use php-cli: php-cli -f /home/timli/public_html/bin/magento deploy:mode:set production php-cli -f /home/timli/public_html/bin/magento setup:static-content:deploy

Always, really always, run these as the cPanel user not root; if these are ran as root you will get root owned files which cause issues.

Finally regarding file ownership and permissions that Magento requires. While Magento does indeed say it requires 770 and 660 for folders and files -- respectively. This is not a firm requirement and with understanding of PHP and Apache server that Magento is running no they are not always necessary. The reason being that with the current setup of Apache with Event and PHP with SuPHP the permissions of 755 and 644 provide the same level of access. As all the files are both user and group owned by the user, there is no need for the group bit to be set to 7, or 6, as the website and Apache/PHP will have all the necessary access through he user alone.