Issue
I've been stuggeling with this problem now for days: Installting Laravel passport. I did all accoring to the tutorial. What I did
composer require laravel/passport
Added Laravel\Passport\PassportServiceProvider::class,
to the config/app.php
run php artisan migrate
and then php artisan passport:install
The crasy thing is this works on my local machine. But when I upload this to my webspace via ftp and run php artisan passport:install
it gets me this Error:
Uncaught exception - 'There are no commands defined in the "passport" namespace.'
Full error (see on 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
What I did.
- uploaded all my code without the ./vendor and composer.lock
- (uploaded the server .env)
php composer.phar clearcace
php composer.phar update
php artisan cache:clear
php artisan config:cache
php artisan migrate
php artisan passport:install
And then the error happens...
If did php composer.phar require laravel/passport
and can see via ftp that in the /vendor/laravel/ the passport folder is there!
Solution
If you run on shared hosting try
export APP_RUNNING_IN_CONSOLE=true
After that you can run php artisan passport:install
Laravel's runningInConsole method check if that environment is set or the output php_sapi_name()
is cli or phpdbg. At a shared host it can be cgi-fcgi
Answered By - KuLi
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.