laravel / passport

Laravel Passport provides OAuth2 server support to Laravel.
https://laravel.com/docs/passport
MIT License
3.27k stars 777 forks source link

Commands and Migrate not registered #197

Closed nilsbrychzy closed 7 years ago

nilsbrychzy commented 7 years ago

Hello,

on my windows machine everything works great, but after deploy (upload everything except the vendor dir) the passport commands and migrate doesn't work.

Output:

****@**** ~/**** $ php artisan migrate
Migration table created successfully.
Migrated: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_100000_create_password_resets_table

****@**** ~/**** $ php artisan passport:install

  [Symfony\Component\Console\Exception\CommandNotFoundException]
  There are no commands defined in the "passport" namespace.

App Config:

/*
 * Package Service Providers...
 */
Laravel\Passport\PassportServiceProvider::class,
craigpaul commented 7 years ago

Did you run composer install on your deployed environment?

nilsbrychzy commented 7 years ago

Yes

$ ./composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize

Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi                          SAPI
Generating optimized class loader
The compiled class file has been removed.

$ php artisan migrate
Nothing to migrate.

$ php artisan migrate:refresh
Rolled back: 2014_10_12_100000_create_password_resets_table
Rolled back: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_100000_create_password_resets_table

$ php artisan migrate:reset
Rolled back: 2014_10_12_100000_create_password_resets_table
Rolled back: 2014_10_12_000000_create_users_table

Same as before

arubacao commented 7 years ago

Sounds like you didn't run composer require laravel/passport

nilsbrychzy commented 7 years ago

It's in composer.json and I run composer install. So it should be installed, or?

nilsbrychzy commented 7 years ago

I ran composer require laravel/passport and it doesn't helped. Same issue as before.

I also found two other with the same problem, perhaps a issue on my side?

arubacao commented 7 years ago

No, not necessarily.

After installing the dependencies, Composer writes the list of the exact versions it installed into a composer.lock file. This locks the project to those specific versions.

This is important because the install command checks if a lock file is present, and if it is, it downloads the versions specified there (regardless of what composer.json says).

If it's in the composer.json, then composer update is the right command to go for

nilsbrychzy commented 7 years ago

No it doesn't helped.

http://laravel.io/forum/11-19-2016-passport-install-error-with-php-artisan-passportinstall

He has the same issue.

I now ran require, install, update and even artisan clear-compiled

nilsbrychzy commented 7 years ago

Files are there:

$ ls vendor/laravel/passport/ -l
total 8
-rw-r--r--+ 1 user users 1269 nov.  19 21:50 composer.json
drwxr-xr-x+ 3 user users    3 nov.  19 21:50 database
-rw-r--r--+ 1 user users 1077 nov.  19 21:50 LICENSE.txt
-rw-r--r--+ 1 user users 1006 nov.  19 21:50 readme.md
drwxr-xr-x+ 4 user users    4 nov.  19 21:50 resources
drwxr-xr-x+ 7 user users   22 nov.  19 21:50 src```
nikkuang commented 7 years ago

@nilsbrychzy did you include composer.lock on your gitignore?

my guess is that you have ignored you composer.lock, and in your server you had the old composer.lock which was not updated when you run composer require laravel/passport since you run this command in your local machine. just include and push your update composer.lock and run composer install again or delete the old composer.lock

since you had this warning

Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them. Nothing to install or update

tri-duong-vn commented 7 years ago

I meet similar problem

@ ~/**** $ php artisan passport:install

[Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "passport" namespace.

themsaid commented 7 years ago

@tri-duong-dena make sure you included the Passport service provider in your app providers.

nilsbrychzy commented 7 years ago

@nikkuang yes i did

suciptoid commented 7 years ago

Same issue on my existing project, but when I create new project, I don't facing this issue.

themsaid commented 7 years ago

@@tri-duong-dena @nilsbrychzy @showcheap

What PHP versions and OS are you running your apps on?

suciptoid commented 7 years ago

MacOS Sierra

PHP 5.6.23 (cli) (built: Jun 26 2016 13:17:47)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

Still no luck

nilsbrychzy commented 7 years ago

I was using php5 and debian 8

tri-duong-vn commented 7 years ago

@themsaid : I've already included the Passport service provider in my app providers. My dev environment: composer 1.2.1 php 5.6.27 MacOS X El Capital 10.11.6

I already tried to use multiple versions of Laravel: 5.3.24 and 5.3.0 Laravel passport: many versions from 0.1.0 to 2.0.x-dev

suciptoid commented 7 years ago

I don't know why, but after re-clone from git repository, run composer install, these issues disappear.

Previously I've done this step, but still no luck:

frodeknutsen commented 7 years ago

It could be some weird opcode cache of sorts? Try restarting php-fpm/your webserver.

Modelizer commented 7 years ago

try composer dump -o

nilsbrychzy commented 7 years ago

I've done the steps from @showcheap and @Modelizer.

Got this:


Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing nikic/php-parser (v3.0.2)
    Downloading: 100%

  - Installing classpreloader/classpreloader (3.1.0)
    Downloading: 100%

  - Installing vlucas/phpdotenv (v2.4.0)
    Downloading: 100%

  - Installing symfony/polyfill-mbstring (v1.3.0)
    Downloading: 100%

  - Installing symfony/var-dumper (v3.1.8)
    Downloading: 100%

  - Installing symfony/translation (v3.1.8)
    Downloading: 100%

  - Installing symfony/routing (v3.1.8)
    Downloading: 100%

  - Installing symfony/process (v3.1.8)
    Downloading: 100%

  - Installing symfony/http-foundation (v3.1.8)
    Downloading: 100%

  - Installing symfony/event-dispatcher (v3.2.1)
    Downloading: 100%

  - Installing psr/log (1.0.2)
    Downloading: 100%

  - Installing symfony/debug (v3.1.8)
    Downloading: 100%

  - Installing symfony/http-kernel (v3.1.8)
    Downloading: 100%

  - Installing symfony/finder (v3.1.8)
    Downloading: 100%

  - Installing symfony/console (v3.1.8)
    Downloading: 100%

  - Installing swiftmailer/swiftmailer (v5.4.4)
    Downloading: 100%

  - Installing paragonie/random_compat (v2.0.4)
    Downloading: 100%

  - Installing ramsey/uuid (3.5.2)
    Downloading: 100%

  - Installing jakub-onderka/php-console-color (0.1)
    Downloading: 100%

  - Installing jakub-onderka/php-console-highlighter (v0.3.2)
    Downloading: 100%

  - Installing dnoegel/php-xdg-base-dir (0.1)
    Downloading: 100%

  - Installing psy/psysh (v0.8.0)
    Downloading: 100%

  - Installing nesbot/carbon (1.21.0)
    Downloading: 100%

  - Installing mtdowling/cron-expression (v1.1.0)
    Downloading: 100%

  - Installing monolog/monolog (1.22.0)
    Downloading: 100%

  - Installing league/flysystem (1.0.32)
    Downloading: 100%

  - Installing symfony/polyfill-util (v1.3.0)
    Downloading: 100%

  - Installing symfony/polyfill-php56 (v1.3.0)
    Downloading: 100%

  - Installing jeremeamia/superclosure (2.3.0)
    Downloading: 100%

  - Installing doctrine/inflector (v1.1.0)
    Downloading: 100%

  - Installing laravel/framework (v5.3.28)
    Downloading: 100%

  - Installing creativeorange/gravatar (1.0.9)
    Downloading: 100%

  - Installing guzzlehttp/promises (1.3.0)
    Downloading: 100%

  - Installing psr/http-message (1.0.1)
    Downloading: 100%

  - Installing guzzlehttp/psr7 (1.3.1)
    Downloading: 100%

  - Installing zendframework/zend-diactoros (1.3.7)
    Downloading: 100%

  - Installing symfony/psr-http-message-bridge (v1.0.0)
    Downloading: 100%

  - Installing phpseclib/phpseclib (2.0.4)
    Downloading: 100%

  - Installing league/event (2.1.2)
    Downloading: 100%

  - Installing lcobucci/jwt (3.2.1)
    Downloading: 100%

  - Installing league/oauth2-server (5.1.3)
    Downloading: 100%

  - Installing guzzlehttp/guzzle (6.2.2)
    Downloading: 100%

  - Installing firebase/php-jwt (v4.0.0)
    Downloading: 100%

  - Installing laravel/passport (v1.0.16)
    Downloading: 100%

  - Installing zizaco/entrust (5.2.x-dev 7455ed4)
    Downloading: 100%

  - Installing fzaninotto/faker (v1.6.0)
    Downloading: 100%

  - Installing hamcrest/hamcrest-php (v1.2.2)
    Downloading: 100%

  - Installing mockery/mockery (0.9.6)
    Downloading: 100%

  - Installing webmozart/assert (1.2.0)
    Downloading: 100%

  - Installing phpdocumentor/reflection-common (1.0)
    Downloading: 100%

  - Installing phpdocumentor/type-resolver (0.2.1)
    Downloading: 100%

  - Installing phpdocumentor/reflection-docblock (3.1.1)
    Downloading: 100%

  - Installing phpunit/php-token-stream (1.4.9)
    Downloading: 100%

  - Installing symfony/yaml (v3.2.1)
    Downloading: 100%

  - Installing sebastian/version (2.0.1)
    Downloading: 100%

  - Installing sebastian/resource-operations (1.0.0)
    Downloading: 100%

  - Installing sebastian/recursion-context (2.0.0)
    Downloading: 100%

  - Installing sebastian/object-enumerator (2.0.0)
    Downloading: 100%

  - Installing sebastian/global-state (1.1.1)
    Downloading: 100%

  - Installing sebastian/exporter (2.0.0)
    Downloading: 100%

  - Installing sebastian/environment (2.0.0)
    Downloading: 100%

  - Installing sebastian/diff (1.4.1)
    Downloading: 100%

  - Installing sebastian/comparator (1.2.2)
    Downloading: 100%

  - Installing phpunit/php-text-template (1.2.1)
    Downloading: 100%

  - Installing doctrine/instantiator (1.0.5)
    Downloading: 100%

  - Installing phpunit/phpunit-mock-objects (3.4.3)
    Downloading: 100%

  - Installing phpunit/php-timer (1.0.8)
    Downloading: 100%

  - Installing phpunit/php-file-iterator (1.4.2)
    Downloading: 100%

  - Installing sebastian/code-unit-reverse-lookup (1.0.0)
    Downloading: 100%

  - Installing phpunit/php-code-coverage (4.0.3)
    Downloading: 100%

  - Installing phpspec/prophecy (v1.6.2)
    Downloading: 100%

  - Installing myclabs/deep-copy (1.5.5)
    Downloading: 100%

  - Installing phpunit/phpunit (5.7.4)
    Downloading: 100%

  - Installing symfony/css-selector (v3.1.8)
    Downloading: 100%

  - Installing symfony/dom-crawler (v3.1.8)
    Downloading: 100%

symfony/var-dumper suggests installing ext-symfony_debug ()
symfony/translation suggests installing symfony/config ()
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/dependency-injection (For loading routes from a service)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/http-kernel suggests installing symfony/browser-kit ()
symfony/http-kernel suggests installing symfony/class-loader ()
symfony/http-kernel suggests installing symfony/config ()
symfony/http-kernel suggests installing symfony/dependency-injection ()
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
ramsey/uuid suggests installing ircmaxell/random-lib (Provides RandomLib for use with the RandomLibAdapter)
ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.)
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :))
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing ext-readline (Enables support for arrow-key history navigation, and showing and manipulating command history.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-copy (Allows you to use Copy.com storage)
league/flysystem suggests installing league/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (~3.0).)
laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (~2.4).)
laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)
laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (~3.0).)
laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (~1.0).)
laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (~2.0).)
phpseclib/phpseclib suggests installing ext-libsodium (SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.)
lcobucci/jwt suggests installing mdanter/ecc (Required to use Elliptic Curves based algorithms.)
league/oauth2-server suggests installing indigophp/hash-compat (Polyfill for hash_equals function for PHP 5.5)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.4.0)
phpunit/phpunit suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
X-Powered-By: PHP/5.6.25
Content-type: text/html; charset=UTF-8

Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI

Status: 500 Internal Server Error
X-Powered-By: PHP/5.6.25
Cache-Control: no-cache, private
Date: Sat, 17 Dec 2016 17:39:17 GMT
Content-type: text/html; charset=UTF-8

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta name="robots" content="noindex,nofollow" />
        <style>
            /* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html */
            html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}

            html { background: #eee; padding: 10px }
            img { border: 0; }
            #sf-resetcontent { width:970px; margin:0 auto; }
                        .sf-reset { font: 11px Verdana, Arial, sans-serif; color: #333 }
            .sf-reset .clear { clear:both; height:0; font-size:0; line-height:0; }
            .sf-reset .clear_fix:after { display:block; height:0; clear:both; visibility:hidden; }
            .sf-reset .clear_fix { display:inline-block; }
            .sf-reset * html .clear_fix { height:1%; }
            .sf-reset .clear_fix { display:block; }
            .sf-reset, .sf-reset .block { margin: auto }
            .sf-reset abbr { border-bottom: 1px dotted #000; cursor: help; }
            .sf-reset p { font-size:14px; line-height:20px; color:#868686; padding-bottom:20px }
            .sf-reset strong { font-weight:bold; }
            .sf-reset a { color:#6c6159; cursor: default; }
            .sf-reset a img { border:none; }
            .sf-reset a:hover { text-decoration:underline; }
            .sf-reset em { font-style:italic; }
            .sf-reset h1, .sf-reset h2 { font: 20px Georgia, "Times New Roman", Times, serif }
            .sf-reset .exception_counter { background-color: #fff; color: #333; padding: 6px; float: left; margin-right: 10px; float: left; display: block; }
            .sf-reset .exception_title { margin-left: 3em; margin-bottom: 0.7em; display: block; }
            .sf-reset .exception_message { margin-left: 3em; display: block; }
            .sf-reset .traces li { font-size:12px; padding: 2px 4px; list-style-type:decimal; margin-left:20px; }
            .sf-reset .block { background-color:#FFFFFF; padding:10px 28px; margin-bottom:20px;
                -webkit-border-bottom-right-radius: 16px;
                -webkit-border-bottom-left-radius: 16px;
                -moz-border-radius-bottomright: 16px;
                -moz-border-radius-bottomleft: 16px;
                border-bottom-right-radius: 16px;
                border-bottom-left-radius: 16px;
                border-bottom:1px solid #ccc;
                border-right:1px solid #ccc;
                border-left:1px solid #ccc;
                word-wrap: break-word;
            }
            .sf-reset .block_exception { background-color:#ddd; color: #333; padding:20px;
                -webkit-border-top-left-radius: 16px;
                -webkit-border-top-right-radius: 16px;
                -moz-border-radius-topleft: 16px;
                -moz-border-radius-topright: 16px;
                border-top-left-radius: 16px;
                border-top-right-radius: 16px;
                border-top:1px solid #ccc;
                border-right:1px solid #ccc;
                border-left:1px solid #ccc;
                overflow: hidden;
                word-wrap: break-word;
            }
            .sf-reset a { background:none; color:#868686; text-decoration:none; }
            .sf-reset a:hover { background:none; color:#313131; text-decoration:underline; }
            .sf-reset ol { padding: 10px 0; }
            .sf-reset h1 { background-color:#FFFFFF; padding: 15px 28px; margin-bottom: 20px;
                -webkit-border-radius: 10px;
                -moz-border-radius: 10px;
                border-radius: 10px;
                border: 1px solid #ccc;
            }
        </style>
    </head>
    <body>
                    <div id="sf-resetcontent" class="sf-reset">
                <h1>Whoops, looks like something went wrong.</h1>
                                        <h2 class="block_exception clear_fix">
                            <span class="exception_counter">1/1</span>
                            <span class="exception_title"><abbr title="ErrorException">ErrorException</abbr> in <a title="/home/*****/vendor/symfony/console/Application.php line 941" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Application.php line 941</a>:</span>
                            <span class="exception_message">proc_open(): fork failed - Resource temporarily unavailable</span>
                        </h2>
                        <div class="block">
                            <ol class="traces list_exception">
       <li> in <a title="/home/****/vendor/symfony/console/Application.php line 941" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Application.php line 941</a></li>
       <li>at <abbr title="Illuminate\Foundation\Bootstrap\HandleExceptions">HandleExceptions</abbr>->handleError('2', 'proc_open(): fork failed - Resource temporarily unavailable', '/home/****/vendor/symfony/console/Application.php', '941', <em>array</em>('descriptorspec' => <em>array</em>(<em>array</em>('pipe', 'w'), <em>array</em>('pipe', 'w')), 'pipes' => <em>null</em>))</li>
       <li>at <abbr title=""></abbr>proc_open('stty -a | grep columns', <em>array</em>(<em>array</em>('pipe', 'w'), <em>array</em>('pipe', 'w')), <em>null</em>, <em>null</em>, <em>null</em>, <em>array</em>('suppress_errors' => <em>true</em>)) in <a title="/home/****/vendor/symfony/console/Application.php line 941" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Application.php line 941</a></li>
       <li>at <abbr title="Symfony\Component\Console\Application">Application</abbr>->getSttyColumns() in <a title="/home/***/vendor/symfony/console/Application.php line 729" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Application.php line 729</a></li>
       <li>at <abbr title="Symfony\Component\Console\Application">Application</abbr>->getTerminalDimensions() in <a title="/home/****/vendor/symfony/console/Application.php line 690" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Application.php line 690</a></li>
       <li>at <abbr title="Symfony\Component\Console\Application">Application</abbr>->getTerminalWidth() in <a title="/home/****/vendor/symfony/console/Application.php line 623" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Application.php line 623</a></li>
       <li>at <abbr title="Symfony\Component\Console\Application">Application</abbr>->renderException(<em>object</em>(<abbr title="ErrorException">ErrorException</abbr>), <em>object</em>(<abbr title="Symfony\Component\Console\Output\ConsoleOutput">ConsoleOutput</abbr>)) in <a title="/home/***/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php line 186" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Handler.php line 186</a></li>
       <li>at <abbr title="Illuminate\Foundation\Exceptions\Handler">Handler</abbr>->renderForConsole(<em>object</em>(<abbr title="Symfony\Component\Console\Output\ConsoleOutput">ConsoleOutput</abbr>), <em>object</em>(<abbr title="ErrorException">ErrorException</abbr>)) in <a title="/home/****/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php line 332" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Kernel.php line 332</a></li>
       <li>at <abbr title="Illuminate\Foundation\Console\Kernel">Kernel</abbr>->renderException(<em>object</em>(<abbr title="Symfony\Component\Console\Output\ConsoleOutput">ConsoleOutput</abbr>), <em>object</em>(<abbr title="ErrorException">ErrorException</abbr>)) in <a title="/home/****/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php line 125" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Kernel.php line 125</a></li>
       <li>at <abbr title="Illuminate\Foundation\Console\Kernel">Kernel</abbr>->handle(<em>object</em>(<abbr title="Symfony\Component\Console\Input\ArgvInput">ArgvInput</abbr>), <em>object</em>(<abbr title="Symfony\Component\Console\Output\ConsoleOutput">ConsoleOutput</abbr>)) in <a title="/home/****/artisan line 35" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">artisan line 35</a></li>
    </ol>
</div>

            </div>
    </body>
</html>
nilsbrychzy commented 7 years ago

I don't think, that this problem is passport related, or?

But again:

$ php artisan passport

  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "passport" is not defined.

X-Powered-By: PHP/5.6.25
Content-type: text/html; charset=UTF-8
Modelizer commented 7 years ago

I suggest you zip your vendor file and extract it on your shared hosting env because it seem your shared hosting has lack of configuration in terms on CLI proc_open(): fork failed - Resource temporarily unavailable

nilsbrychzy commented 7 years ago

When I comment https://github.com/laravel/passport/blob/1.0/src/PassportServiceProvider.php#L37 this, then the command exists...

With my change

$ php artisan passport

  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "passport" is not defined.
  Did you mean one of these?
      passport:install
      passport:client
      passport:keys

X-Powered-By: PHP/5.6.25
Content-type: text/html; charset=UTF-8

Without my change

$ php artisan passport

  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "passport" is not defined.

X-Powered-By: PHP/5.6.25
Content-type: text/html; charset=UTF-8
nilsbrychzy commented 7 years ago

Everything works well

$ php artisan migrate
Migrated: 2016_06_01_000001_create_oauth_auth_codes_table
Migrated: 2016_06_01_000002_create_oauth_access_tokens_table
Migrated: 2016_06_01_000003_create_oauth_refresh_tokens_table
Migrated: 2016_06_01_000004_create_oauth_clients_table
Migrated: 2016_06_01_000005_create_oauth_personal_access_clients_table
X-Powered-By: PHP/5.6.25
Content-type: text/html; charset=UTF-8

$ php artisan passport:install
Encryption keys generated successfully.
Personal access client created successfully.
Client ID: 1
Client Secret: ***
Password grant client created successfully.
Client ID: 2
Client Secret: ***
X-Powered-By: PHP/5.6.25
Content-type: text/html; charset=UTF-8

Perhaps there is a problem with https://github.com/laravel/passport/blob/1.0/src/PassportServiceProvider.php#L37 on shared hosts?

Modelizer commented 7 years ago

Yes, Most of the shared hosting is not able to provide the best support for PHP CLI.

nilsbrychzy commented 7 years ago

So should I let it modified on my side, or is there any chance to fix it?

Modelizer commented 7 years ago

The problem is not with this https://github.com/laravel/passport/blob/1.0/src/PassportServiceProvider.php#L37 Problem is with your Incompatible CLI version. Contact your hosting provider if they can help you or go with free AWS EC2 instances. This would be much better than shared hosting but you need to configure everything from scratch.

Right now I don't have Idea how can we fix process related problems in share hosting env.

suciptoid commented 7 years ago

@Modelizer It's also happened on the local machine.

Modelizer commented 7 years ago

@showcheap Do you guys have install php5-cli version on local? Is CLI SAPI enabled? checkout http://php.net/manual/en/features.commandline.introduction.php

suciptoid commented 7 years ago

@Modelizer Sure, I have php5-cli installed, and yes CLI SAPI enabled.

Modelizer commented 7 years ago

Okay then what you get when you run this command php -r 'echo php_sapi_name() . PHP_EOL;' ?

ejulfaey commented 7 years ago

I faced the same problem too, I just clear the cache with php artisan config:cache

d8vjork commented 7 years ago

Same problem here, using Windows 10 (IIS 10) with PHP 7.1 (FastCGI)

yasseralsamman commented 7 years ago

I had the same problem, and after wasting a couple of hours, I solved it like the following:

  1. delete vendor folder
  2. delete composer.lock file
  3. run composer clearcache
  4. run composer install
  5. go to config/app.php and make sure you added Laravel\Passport\PassportServiceProvider::class to the providers array.
  6. run php artisan cache:clear
  7. run php artisan config:cache
  8. run php artisan migrate
  9. run php artisan passport:install

I have no idea what happened exactly, but it worked.

Langstra commented 7 years ago

@yasseralsamman I think between step 7 and 8 you want to add php artisan migrate

I faced the same problems and solved it using the steps provided.

yasseralsamman commented 7 years ago

@Langstra , Yes you are right , I edited the comment and added the migrate step. I'm using Moloquent so I didn't have to migrate. My bad.

thrazu commented 7 years ago

I have solved this way:

  1. Empty the table migrations in database
  2. Run php artisan migrate It works!
newelement commented 7 years ago

I'm having this same issue installing Laravel on subdomain using DigitalOcean server.

ManuelSamudio commented 7 years ago

I have solved it like this:

  1. php artisan cache:clear
  2. php artisan config:cache
  3. php artisan passport:install

OS: Centos 7 Php -v: 5.6.30 Laravel -v: 5.4

mossen commented 7 years ago

In my case using Laravel 5.3:

In composer.json "laravel/passport": "~1.0" => "laravel/passport": "^1.0"

1- remove composer.lock 2- composer install 3- php artisan migrate

it seems Laravel 5.3 has some issues with passport 2.*

themsaid commented 7 years ago

Closing for lack of activity, hope you got the help you needed :)

CodeOcee commented 7 years ago

In Laravel 5.4 "php artisan config:cache" i think it will fix the problem.

jagadeshanh commented 7 years ago

I had the same issue and I resolved it by running

composer dump-autoload

php artisan config:cache

rattfieldnz commented 7 years ago

Adding to @jagadeshanh's answer...

After I ran the php artisan config:cache command, my APP_ENV key value became null (through dd'ing the key to browser output). I found that, after running the command, I had to delete the bootstrap/cache/config.php to get things resuming as normal. This is probably common knowledge to most Laravel devs here, but it might help others who are freshers.

chintanvadi commented 6 years ago

PHP warning: unlink(public/storage/images\f11cfb998feafdda17a37df38b421b46.jpg): Resource temporarily unavailable in D:\wamp64\www\ajaxdemo\vendor\fzaninotto\faker\src\Faker\Provider\Image.php on line 91

TimOgilvy commented 6 years ago

Doing this on homestead, same problem. Not sure this should still be closed - it seems pretty common under standard operating conditions.

BangIyan commented 5 years ago

I had the same issue and I resolved it by running

go to config/app.php and make sure you added Laravel\Passport\PassportServiceProvider::class

And

php artisan migrate:fresh

php artisan passport:install

csb346 commented 5 years ago

I have the same issue with a 5.7 instance on my local machine. I tried everything related in this issue and still not working :(

Any clue?

csb346 commented 5 years ago

Today I tried another approach... I created a new laravel project and try it again to install passport. Everything ok... so the problem should be on my project. I discovered that if I remove one of the packages that I have required, everything works fine! The package is https://github.com/in-the-beam/laravel-locale-selector

Maybe it can help others. If you have tried everything stated in here, check your installed packages :)