Magento 2.3.2 Production Mode – Fix Production Mode Not Working

magento2.3.2production-mode

i have run production command but not working

php bin/magento deploy:mode:set production

enter image description here

when I run deploy command

php bin/magento setup:static-content:deploy -f

and Below type Error showing

Command returned non-zero exit code: `/opt/alt/php71/usr/bin/php -f

When i run Below deploy command and working Fine but i can not set to production mode

php bin/magento setup:static-content:deploy

enter image description here

Best Answer

Run below command in sequence for move website to production mode.

sudo chmod -R 0777 pub var generated
sudo php bin/magento setup:upgrade
sudo php bin/magento deploy:mode:set production -s
sudo php bin/magento setup:di:compile
sudo chmod -R 0777 pub var generated
sudo php bin/magento setup:static-content:deploy -f
sudo chmod -R 0777 pub var generated
sudo php bin/magento cache:flush
sudo chmod -R 0777 pub var generated

Note : Remove sudo if you have not access for root user

Related Topic