我一直在這個問題上拼命工作幾天:安裝Laravel護照。我完全贊同這個教程。我所做的Laravel 5.4護照 - 命令未定義
composer require laravel/passport
新增Laravel\Passport\PassportServiceProvider::class,
到config/app.php
運行php artisan migrate
然後php artisan passport:install
的crasy事情是這樣的作品在我的本地機器上。但是,當我上傳此通過FTP我的網絡空間,並運行php artisan passport:install
能把我這個錯誤:
完整的錯誤(見pastbin)
PHP Fatal error: Uncaught exception 'Symfony\Component\Console\Exception\CommandNotFoundException' with message 'There are no commands defined in the "passport" namespace.' in /mnt/web102/d0/25/58432925/htdocs/www/vendor/symfony/console/Application.php:533
Stack trace:
#0 /mnt/web102/d0/25/58432925/htdocs/www/vendor/symfony/console/Application.php(565): Symfony\Component\Console\Application->findNamespace('passport')
#1 /mnt/web102/d0/25/58432925/htdocs/www/vendor/symfony/console/Application.php(204): Symfony\Component\Console\Application->find('passport:instal...')
#2 /mnt/web102/d0/25/58432925/htdocs/www/vendor/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /mnt/web102/d0/25/58432925/htdocs/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Comp in /mnt/web102/d0/25/58432925/htdocs/www/vendor/symfony/console/Application.php on line 533
PHP Fatal error: Uncaught exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Uncaught exception 'Symfony\Component\Console\Exception\CommandNotFoundException' with message 'There are no commands defined in the "passport" namespace.' in /mnt/web102/d0/25/58432925/htdocs/www/vendor/symfony/console/Application.php:533
Stack trace:
#0 /mnt/web102/d0/25/58432925/htdocs/www/vendor/symfony/console/Application.php(565): Symfony\Component\Console\Application->findNamespace('passport')
#1 /mnt/web102/d0/25/58432925/htdocs/www/vendor/symfony/console/Application.php(204): Symfony\Component\Console\Application->find('passport:instal...')
#2 /mnt/web102/d0/25/58432925/htdocs/www/vendor/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /mnt/web102/d0/25/58432925/htdocs/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Consol in /mnt/web102/d0/25/58432925/htdocs/www/vendor/symfony/console/Application.php on line 533
Status: 500 Internal Server Error
X-Powered-By: PHP/5.6.30
Content-type: text/html
我做了什麼。
- 上傳了我的所有代碼,而不./vendor和composer.lock
- (上傳服務器.ENV)
php composer.phar clearcace
php composer.phar update
php artisan cache:clear
php artisan config:cache
php artisan migrate
php artisan passport:install
然後錯誤發生...
如果沒有php composer.phar require laravel/passport
,並且可以通過FTP看到,在/供應商/ laravel /護照夾是存在的!
您確定已經將'Laravel \ Passport \ PassportServiceProvider :: class'添加到'providers'數組嗎?看起來這是你唯一能做錯的事情。 – Tajgeer
我做了,我做了,hundret次檢查。它運行在我的本地機器上......所以服務器上肯定有東西破壞 –
那麼'php artisan'的輸出是什麼? – Tajgeer