There are some default good practice when installing/configure a server and I think is good to follow them and improve where is possible. I tend to use [ apt ] instead of [ apt-get ] as they are almost the same: apt is designed for end-users (human) and its output may be changed between versions > Means the output is…
PHP extension mcrypt, intl, … missing as composer uses default environment

M2 Defining a plugin
A plugin is used to extend or modify a public method’s behaviour by applying code before, after, or around that observed method. The first argument for the before, after, and around methods is an object that provides access to all public methods of the observed method’s class. Note: The rest of the parameters for these functions are depending on…
Clear Cache in Magento 2

The cache is the biggest issue when you develop so you need to know all the possible ways of cleaning it. There are 3 way to clean the cache (similar to Magento 1): From the backend (Admin): Through command-line (CLI) tool:
1 2 3 4 5 6 7 8 9 10 |
# in your Magento root folder # the php from the beginning of the line can be omitted # -- cache:clean deletes the cache storage php bin/magento cache:clean # -- cache:flush will wipe out everything php bin/magento cache:flush |
Manually removing the cache files:
1 2 3 4 |
# from magento root directory in command line run the command rm -rf var/cache/* |
You can also check the cache status First of…
Maintenance mode (M2)
Magento 2 can run in one of three primary modes -- developer, production, and default. But aside from that ones there is also a maintenance mode, which is used when you want to make the site unavailable to the public during updates or other changes. You don’t use the MAGE_MODE variable -- instead, you create a…
Set Environment Variable [Developer or Production Mode] (M2)
First, will be a good idea to check the current MODE:
1 2 3 |
php bin/magento deploy:mode:show |
The main idea is to have this (environment) variable MAGE_MODE set to one of this values: Default Developer Production To change the MODE in Magento for the moment there are 3 ways: From CLI (you'll be 100% sure it changed)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# we are using the Magento deploy in order to change the mode # there are 3 possible values: # * default # * developer # * production # # BUT there is a CATCH: once you changed # the DEFAULT mode you can NOT go back to it # make it into Developer mode php bin/magento deploy:mode:set developer # for Production mode php bin/magento deploy:mode:set production |
Using the .htaccess file:
1 2 3 4 5 |
# add the following line in the main .htaccess file SetEnv MAGE_MODE developer |
Through your WEB…