警告:openssl_pkcs7_sign():使用WAMP获取私钥时出错 [英] Warning: openssl_pkcs7_sign(): error getting private key using WAMP
本文介绍了警告:openssl_pkcs7_sign():使用WAMP获取私钥时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用TCPDF签名PDF,但出现此错误:
I am trying to sign PDF using TCPDF, but I have got this error:
Warning: openssl_pkcs7_sign(): error getting private key in C:\wamp\www\tcpdf\tcpdf.php on line 7594.
我的PHP版本是5.5.12和TCPDF 6.2.11. Windows7.
My PHP version is 5.5.12 and TCPDF 6.2.11. Windows 7.
其他示例运行良好,但是失败了.我已经尝试过:
Other examples run well but this fails. I have tried:
'file://'.( dirname(FILE)).'./path/to/file' and again $certificate = 'file://'.realpath('../tcpdf.crt');
但不适用于我.
推荐答案
您需要'file://'前缀和文件的真实路径:
You need the 'file://' prefix and the realpath to file:
//in your case
$certificate = 'file://'.realpath('../tcpdf.crt');
// OR for other cases
$certificate = 'file://'.realpath('/tcpdf.crt');
// OR
$certificate = 'file://'.realpath('C:/tcpdf.crt');
这篇关于警告:openssl_pkcs7_sign():使用WAMP获取私钥时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文