How do i run 'composer' command via SSH?

社会主义新天地 提交于 2021-02-07 10:53:43

问题


I want to reload my project's custom classes in Laravel so they become accessible, but on a shared hosting enviroment. To my understanding, so far, locally, I've been achieving the desired by using this command:

composer dump-autoload

however, running that via putty's SSH gives me:

-bash: composer: command not found

Any idea?


回答1:


You have to install composer on the remote machine that your are ssh'ing to. You can find installation instructions on the composer homepage.




回答2:


please try:

php composer.phar dump-autoload

Because composer is only avaialble when installed globally, into /usr/local/bin/composer path.

Hope that helps!




回答3:


Try this command: # php-cli composer.phar --help

In some servers Composer should be invoked via the CLI




回答4:


Try:

php composer.phar dump-autoload

or

php composer.phar update



回答5:


In webfaction is: php54 composer.phar dump-autoload




回答6:


If you are running in a production environment make sure to run:

[path to composer.phar] dump-autoload --optimize

This will autoload ony the necessary classes and GREATLY increase performance of your Laravel app.



来源:https://stackoverflow.com/questions/17013057/how-do-i-run-composer-command-via-ssh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!