Laravel openssl_private_encrypt(): 密钥参数不是有效的私钥
Laravel openssl_private_encrypt(): key param is not a valid private key
我正在尝试使用 PHP-Chef. I have tried to set up my chef config with the data that I got from knife.rb in .chef folder. I have setup client and a key according to the instructions from Knife.rb 与 Laravel 连接到 Chef API。但我得到:
openssl_private_encrypt(): key param is not a valid private key
在我的控制器中,当我执行 dd($this->key)
时,我在 return 中得到空值。这是我的控制器:
protected $server;
protected $client;
protected $key;
protected $version;
public function ___construct()
{
$this->server = config('chef.server');
$this->client = config('chef.client');
$this->key = config('chef.key');
$this->version = config('chef.version');
}
/**
* Get all dns records
*/
public function index()
{
dd($this->key);
$chef = new Chef($this->server, $this->client, $this->key, $this->version);
// API request
$response = $chef->get('/');
dd($response);
}
这是我的配置 chef.php
return [
'server' => 'https://172.16.0.227:443/organizations/myOrganizationsName',
'client' => 'chef-validator',
'key' => '/Users/myName/.chef/ORGANIZATION-validator.pem',
'version' => '12.7.0',
"enterprise" => false
];
因为我猜它是正确的,所以只是复制它来回答,但这闻起来像错误的密钥路径或文件权限,以至于 PHP 无法读取密钥数据。
我正在尝试使用 PHP-Chef. I have tried to set up my chef config with the data that I got from knife.rb in .chef folder. I have setup client and a key according to the instructions from Knife.rb 与 Laravel 连接到 Chef API。但我得到:
openssl_private_encrypt(): key param is not a valid private key
在我的控制器中,当我执行 dd($this->key)
时,我在 return 中得到空值。这是我的控制器:
protected $server;
protected $client;
protected $key;
protected $version;
public function ___construct()
{
$this->server = config('chef.server');
$this->client = config('chef.client');
$this->key = config('chef.key');
$this->version = config('chef.version');
}
/**
* Get all dns records
*/
public function index()
{
dd($this->key);
$chef = new Chef($this->server, $this->client, $this->key, $this->version);
// API request
$response = $chef->get('/');
dd($response);
}
这是我的配置 chef.php
return [
'server' => 'https://172.16.0.227:443/organizations/myOrganizationsName',
'client' => 'chef-validator',
'key' => '/Users/myName/.chef/ORGANIZATION-validator.pem',
'version' => '12.7.0',
"enterprise" => false
];
因为我猜它是正确的,所以只是复制它来回答,但这闻起来像错误的密钥路径或文件权限,以至于 PHP 无法读取密钥数据。