拉拉维尔API认证(护照);ErrorException in CryptKey.php.



ErrorException in CryptKey.php第57行:

密钥文件"file://C:\wamp\www\project\public_html\storage\oauth-private.key"权限不正确,应为 600 或 660 而不是 666

我的配置如下:

  • 视窗 10 64 位
  • 万姆服务器 3.1.0
  • 阿帕奇 2.4.27
  • 菲律宾比索 7.0.23
  • Laravel框架版本5.3.31
  • 作曲家需要拉拉维尔/护照=~1.0

知道如何解决吗?

您可以在第 57 行关闭文件检查权限

您的加密密钥路径已vendor/league/oauth2-server/src/CryptKey.php

在第 48 行将其转换为 false 或注释CryptKey.php中的以下块

if ($keyPermissionsCheck === true) {
// Verify the permissions of the key
$keyPathPerms = decoct(fileperms($keyPath) & 0777);
if (in_array($keyPathPerms, ['600', '660'], true) === false) {
trigger_error(sprintf(
'Key file "%s" permissions are not correct, should be 600 or 660 instead of %s',
$keyPath,
$keyPathPerms
), E_USER_NOTICE);
}
}

keyPermissionsCheck将其设置为 false。

希望这有帮助。

只需将oauth-private.key文件CHMOD转换为600或660即可。我看到您使用Windows,因此您肯定可以按照本文中的说明进行操作。

最新更新