问题
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