Magento 2.3.2 Production mode not working
-
14-03-2021 - |
Question
i have run production command but not working
php bin/magento deploy:mode:set production
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
Solution
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
OTHER TIPS
First run the following command:
php bin/magento deploy:mode:set production -s
After that you can run following in sequence:
sudo rm -rf var/cache/* var/page_cache/* generated/*
sudo chmod -R 777 var/ generated/ pub/static/ app/etc/ pub/media/
sudo php bin/magento setup:upgrade
sudo chmod -R 777 var/ generated/ pub/static/ app/etc/ pub/media/
php -d memory_limit=5G bin/magento setup:static-content:deploy
sudo chmod -R 777 var/ generated/ pub/static/ app/etc/ pub/media/
php -d memory_limit=5G bin/magento setup:di:compile
sudo chmod -R 777 var/ generated/ pub/static/ app/etc/ pub/media/
Let me know if still have same issue?
Remove theme folders from pub/static after setting to production mode
rm -rf pub/static/frontend/
and then run
php -dmemory_limit=6G bin/magento setup:static-content:deploy -f
OR
php -dmemory_limit=6G bin/magento setup:static-content:deploy
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange