Set production mode magento 2.3
-
14-04-2021 - |
Pregunta
I want to switch to production mode but I can not find information about the exact commands that I have to use. I know that I must use this command:
php bin/magento deploy:mode:set production
But, do I need to make some change of permission for the folders? Do I need to execute some more command before or after using the command to change to production mode?
UPDATE
These are the commands I use to give permissions to my Magento files and folders:
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chown -R :www-data .
chmod u+x bin/magento
Solución
You can use this command to set production mode:
bin/magento deploy:mode:set production
Note: If you are going to switch from Developer to Production mode two actions must first be taken.
1) Static Deploy (bin/magento setup:static-content:deploy)
2) Compilation (bin/magento setup:di:compile)
Otros consejos
You only need to run this command, to switch to production mode
php bin/magento deploy:mode:set production
In case, you get blank screen, You should run
php bin/magento setup:upgrade
then
php bin/magento setup:static-content:deploy
then
php bin/magento indexer:reindex
That's enough!