error:02001002:system library:fopen:No such file or directory
opiums9 opened this issue · 2 comments
opiums9 commented
Hi, I'm getting an error
[15-Apr-2020 18:22:27 Asia/Krasnoyarsk] PHP Fatal error: Uncaught exception 'Exception' with message 'Could not load account key: file://account_key.pem (error:02001002:system library:fopen:No such file or directory)' in ...\ACMECert.php:464
Stack trace:
#0 ...\ACMECert\index.php(26): ACMEv2->loadAccountKey('file://account_...')
#1 {main}
thrown in ...\ACMECert.php on line 464
in PHP version 5.6.40 x64. But I do not get errors in version 5.6.31 x86. Searching the Internet, I assume that openssl cannot find the configuration file, can I specify it somewhere in the code?
My code:
if(isset($_POST['Register_Account_Key_with_Lets_Encrypt'])){
require 'ACMECert.php';
$ac = new ACMECert();
$ac->loadAccountKey('file://'.'account_key.pem');
$ret=$ac->register(true,'admin@domain.tld');
print_r($ret);
echo '<a href="./">back</a>';
exit;
}
skoerfgen commented
Hello,
the configuration file can't be specified somewhere in the code, but from the error message it sounds more like the account_key.pem
itself was not found. Or maybe the current working directory has changed (you can check this with getcwd).
I'd try the following:
require 'ACMECert.php';
$ac=new ACMECert();
$key=file_get_contents('account_key.pem');
if (!$key) die('failed to load account_key.pem in directory '.getcwd());
$ac->loadAccountKey($key);
$ret=$ac->register(true,'admin@domain.tld');
opiums9 commented
Sorry, I get the same error. I believe the problem is in php_openssl.dll for windows. I will also continue to use version 5.6.31 to create certificates in which there are no such problems.