Magento – Magento Command Line Global Commands

command linemagento2

I am in a Digital Ocean Ubuntu droplet trying to toggle development mode in my Magento installation so that I can develop a theme.

My problem is I can't figure out how to run magento deploy:mode:set developer

I gather I have to make the magento command global.

Well I tried: export PATH=/var/www/html/example.com/public_html/bin:$PATH

and that did not work.

If I type magento into the terminal it says Command Not Found.

Please assist.

Best Answer

Another method would be to use alias

touch ~/.bash_profile
nano ~/.bash_profile

then add

alias magento="php bin/magento"

Log out and back in or run

 source ~/.bash_profile

You could change 'magento' to whatever you want (i.e 'm' or 'mage' etc)

Related Topic