laravel 我如何通过 SSH 运行“composer”命令?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17013057/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do i run 'composer' command via SSH?
提问by Daniel Birowsky Popeski
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:
我想在 Laravel 中重新加载我项目的自定义类,以便它们可以访问,但在共享托管环境中。据我了解,到目前为止,在本地,我已经通过使用以下命令实现了预期:
composer dump-autoload
however, running that via putty's SSH gives me:
但是,通过 putty 的 SSH 运行它给了我:
-bash: composer: command not found
Any idea?
任何的想法?
回答by huglester
please try:
请尝试:
php composer.phar dump-autoload
php composer.phar dump-autoload
Because composer
is only avaialble when installed globally, into /usr/local/bin/composer path.
因为composer
只有在全局安装时才可用,进入 /usr/local/bin/composer 路径。
Hope that helps!
希望有帮助!
回答by Jarlskov
You have to install composer on the remote machine that your are ssh'ing to. You can find installation instructions on the composer homepage.
您必须在要通过 ssh 连接的远程机器上安装 composer。您可以在composer 主页上找到安装说明。
回答by Hymanss
Try this command: # php-cli composer.phar --help
试试这个命令: # php-cli composer.phar --help
In some servers Composer
should be invoked via the CLI
在某些服务器中Composer
应该通过调用CLI
回答by Ronald Do
Try:
尝试:
php composer.phar dump-autoload
or
或者
php composer.phar update
回答by Elliot Fehr
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.
这将自动加载任何必要的类,并大大提高 Laravel 应用程序的性能。
回答by RamiroRS
In webfaction is: php54composer.phar dump-autoload
在网络中是:php54composer.phar dump-autoload