Magento SSH/CLI kommandoer


OPPLEVER DU PROBLEMER MED VÅRE TJENESTER? KJØR DIAGNOSE FØRST FOR Å SPARE DIN OG VÅR TID

Lagt til: 07.07.2020 15:51:36     Sist oppdatert: 07.07.2020 15:51:36

Magento SSH/CLI kommandoer

Hvis en benytter Magento 2 så er det nødvendig å benytte SSH/CLI kommandoer for å få utført nødvendige oppgaver. Dokumentasjonen til Magento kan være uoversiktlig og kommandoene ligger ikke noe sted samlet, derfor har vi samlet de mest nyttige og brukte kommandoene.

Kommandoene nedenfor går ut i fra at en er i samme mappe som selve nettsiden.

1. Hjelp
Kommandoen nedenfor vil liste opp subkommandoer og parametre som er mulig å benytte.

php bin/magento help


2. Lister med kommandoer
Denne vil liste alle mulige kommandoer en kan kjøre for Magento 2.

php bin/magento list


3. Cache
Vis cache status.

php bin/magento cache:status

Tøm cache.

php bin/magento cache:flush

Rensk cache

php bin/magento cache:clean


4. Modus
Se status på hvilken modus som er i bruk.

php bin/magento deploy:mode:show

Endre til utvikler modus

php bin/magento deploy:mode:set developer

Endre til produksjons modus

php bin/magento deploy:mode:set production

5. Vedlikehold
Sjekk status om siden er satt til vedlikehold.

php bin/magento maintenance:status

6. Indeksering
Denne viser status på indeksene.

php bin/magento indexer:status

Reindekser

php bin/magento indexer:reindex

7. Moduler
Denne viser moduler som er installert

php bin/magento module:status