Warning: openssl_pkcs7_sign() [function.openssl-pkcs7-sign]: error getting private key in C:\xampp\htdocs\this\tcpdf\tcpdf.php on line 8366

lionc picture lionc · Aug 17, 2011 · Viewed 6.9k times · Source

I am using TCPDF to sign PDF, but when running the example 52 I got this error:

Warning: openssl_pkcs7_sign() [function.openssl-pkcs7-sign]: error getting 
private key in C:\xampp\htdocs\this\tcpdf\tcpdf.php on line 8366

Could you please tell me or guide me where is the problem. I am just running the example without changing anything. I am using xampp.

Answer

NamingException picture NamingException · Oct 19, 2011

The problem is with the location from where it tries to access the private key. Instead of '' like in their example use 'file://'.( dirname(FILE)).'./path/to/file'. This worked for me.