Showing posts with label Deploy. Show all posts
Showing posts with label Deploy. Show all posts

Thursday 26 April 2018

How to reindex | Upgrade | static-content:deploy | Cache flush | Cache clean | Important commands in Magento 2

You need to put this command on CMD | Terminal


For Upgrade data in Magento 2
php -dmemory_limit=5G bin/magento setup:upgrade 
For code compile
php bin/magento setup:di:compile
For Reindex data in Magento 2
php -dmemory_limit=5G bin/magento indexer:reindex
For Static Content Deploy data  in Magento 2
php -dmemory_limit=5G bin/magento setup:static-content:deploy -f
For Flush Cache in Magento 2
php -dmemory_limit=5G bin/magento cache:flush
For Clean Cache in Magento 2
php -dmemory_limit=5G bin/magento cache:clean
For generate a new image cache
bin/magento catalog:image:resize 
For Files and Directory Permission
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find var pub/static pub/media  generated/ app/etc -type f -exec chmod g+w {} \;
find var pub/static pub/media generated/ app/etc -type d -exec chmod g+ws {} \;
chown -R ubuntu:www-data .
chmod u+x bin/magento
chmod -R 777 .