문제

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
도움이 되었습니까?

해결책

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)

다른 팁

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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top