php - oauth-private.key 不存在或不可读

标签 php laravel laravel-5 oauth-2.0 laravel-passport

因此,我从 Bitbucket 导入了另一个项目并尝试使用 php artisan serve 启动它,但我总是收到此错误:

[LogicException]                                                                   
  Key path "file:///var/www/html/DesignViewer5/storage/oauth-private.key" does not   
  exist or is not readable                                                           

我自己做项目的时候没有出现这个错误,我不能运行任何其他命令。我尝试了“php artisan key:generate”,但得到了完全相同的错误。

我试过:composer update,得到了这个:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Updating spatie/laravel-permission (1.11.1 => 1.12.0) Downloading: 100%         
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize


  [LogicException]                                                             
  Key path "file:///var/www/html/DesignViewer5/storage/oauth-private.key" doe  
  s not exist or is not readable                                               


Script php artisan optimize handling the post-update-cmd event returned with error code 1

有人知道怎么解决吗?谢谢!

最佳答案

我认为这是由于 Laravel Passport,您应该尝试以下命令:

php artisan passport:install

This command will create the encryption keys needed to generate secure access tokens. In addition, the command will create "personal access" and "password grant" clients which will be used to generate access tokens

来源:https://laravel.com/docs/5.4/passport

关于php - oauth-private.key 不存在或不可读,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42795011/

相关文章:

php - 在 laravel 中将文件从 url 上传到 AWS

php - 将 jquery 变量传递给 php

php - 使用远程图像和样式表将 PHP HTML 内容转换为 DOC/PDF

php - 内存不足PHP Laravel 5.6

php - 从单个 MySQL 表重构 Laravel eloquent 中的数据

php artisan migrate 卡在命令的开头

mysql - 即使存在,Laravel sync 也会抛出完整性异常

javascript - 提交表格前检查条款和条件

php - Composer 版本匹配错误 laravel + spatie medialibrary

php - Laravel DataTables 大导出