oauth-private.key不存在或在laravel中不可读 [英] oauth-private.key does not exist or is not readable in laravel

查看:508
本文介绍了oauth-private.key不存在或在laravel中不可读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Laravel Framework 6.13.1编写的gitlab克隆一个使用护照库的项目.像往常一样,我首先执行了 composer install ,但出现了这个错误:

I clone a project from gitlab written by Laravel Framework 6.13.1 that use passport library. As usual I first executed composer install but i got this error :

   LogicException  : Key path "file://C:\xampp\htdocs\myproject\storage\oauth-private.key" does not exist or is not readable

  at C:\xampp\htdocs\myproject\vendor\league\oauth2-server\src\CryptKey.php:48
    44|             $keyPath = 'file://' . $keyPath;
    45|         }
    46|
    47|         if (!file_exists($keyPath) || !is_readable($keyPath)) {
  > 48|             throw new LogicException(sprintf('Key path "%s" does not exist or is not readable', $keyPath));
    49|         }
    50|
    51|         if ($keyPermissionsCheck === true) {
    52|             // Verify the permissions of the key

  Exception trace:

  1   League\OAuth2\Server\CryptKey::__construct("file://C:\xampp\htdocs\myproject\storage\oauth-private.key")
      C:\xampp\htdocs\note-server\vendor\laravel\passport\src\PassportServiceProvider.php:248

  2   Laravel\Passport\PassportServiceProvider::makeCryptKey("private")
      C:\xampp\htdocs\note-server\vendor\laravel\passport\src\PassportServiceProvider.php:214

现在我无法运行php artisan命令,但遇到相同的错误

问题出在哪里?为什么我得到这个错误?我在互联网上搜索它,有人说运行 php artisanpassport:install 或其他命令,但是由于出现相同的错误,我现在无法运行 php artiasan

where is the problem? why i got this error? i search it in internet some one say run php artisan passport:install or other command but i can not now run php artiasan because got same error

推荐答案

由于/storage/*.key 位于 .gitignore 中,因此如果您拉项目,则通过运行可能会丢失密钥

Since /storage/*.key is in .gitignore so if you pull the project, that might be missing the key by running

 php artisan passport:keys

将为您生成新密钥.

这篇关于oauth-private.key不存在或在laravel中不可读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆