Vous êtes sur la page 1sur 1

Brought to you by

COMMAND

EXAMPLE USE

COMMAND

EXAMPLE USE

php magento cron:run

php magento cron:run

php magento help

php magento help <command> php magento


e.g.
deploy:mode:setproduction
After development is finished you
php magento help cache:clean

Displays help/info about a


command.

Runs all cron jobs by schedule.

php magento list

php magento list

Lists all available CLI commands.

COMMAND

EXAMPLE USE

php magento indexer:reindex

php magento indexer:reindex

Runs all available indexes.

COMMAND

EXAMPLE USE

php magento maintenance:enable php magento


maintenance:enable
Enable maintenance mode.
With your IP exempt:
COMMAND

EXAMPLE USE

php magento cache:clean

Clear all caches:

Cleans caches; only works on

php magento cache:clean


Example use for
clearing a single cache:

php magento
maintenance:enable
ip=<yourwanip>

COMMAND

set your Magento 2 to this mode


to harden your setup (exceptions
are not displayed to the user, only
logged to log files), and the view
files for your site are cached for
greater performance.

php magento
deploy:mode:setdeveloper

EXAMPLE USE

php magento
deploy:mode:setproduction
Sets Magento
mode. After development is finished
you set your Magento 2 to this
mode to harden your setup
(exceptions are not displayed to the
user only logged to log files), and the
view files for your site are cached
for greater performance.

php magento
deploy:mode:setdeveloper

Developer mode is less secure than


Production mode but provides verbose
logging (errors displayed in browser)
enhanced debugging and disables static
view file caching. As a result of these
things it performs slower but extra
debugging functionality helps at the build
stage of your site.

php magento maintenance:disable php magento


maintenance:disable
Disable maintenance mode.

php magento cache:clean config


processes or applications. As such
it is safer than flush.
COMMAND

php magento cache:flush

Flush all caches:

Flushes/purges cache storage used


by all or specified caches. This can
affect other processes or
applications using the storage so
try clean before using this.

php magento cache:flush

php magento setup:di:compile

Example use for


flushing a single cache:

Recompile your Magento 2


codebase.

php magento cache:flush config

COMMAND

EXAMPLE USE

php magento sampledata:deploy

php magento
sampledata:deploy

Install sample data into a store which


mple data. Requires
php magento setup:di:compile compile as shown opposite.
EXAMPLE USE

php magento sampledata:remove


Remove sample data from store
with sample data installed.

php magento
sampledata:remove