Hi everyone,
Today I meet a strange problem while the function Openssl_get_publickey () runs well in PHP 7 and report an error in PHP5 . 6.16 and php5.5.12
Here is the test code:
<?php
Define a PEM formatted string varaible named $key
$key = <<<eof
-----BEGIN Public KEY-----
migfma0gcsqgsib3dqebaquaa4gnadcbiqkbgqcnxj/9qwvfgouh/ y2w89l6bkrafljhnhgpdypubv64bfqnn1pjbczkim6qrdkbolpxmkkmifynkd6raoprih3/prqeb/vsw8oom8fxn67udyuybtqa23mml9q1+ Ilizwbc2aq2ubvorfxffl75p6/b5ksing9zpgmlcuyulkxplqidaqab
-----END Public KEY-----
EOF;
Get the public key
$res = Openssl_get_publickey ($key);
Var_dump ($res);
?>
While in php7.0.0 the result is normal and correct the output
{
D:\wamp64\www\php\index.php (): eval () ' D code:24:resource (4, OpenSSL key)
}
But isn't the same result in PHP 5.6.16 and PHP 5.5.12 This is the output
{
D:\wamp64\www\php\index.php (): eval () ' d Code:24:boolean false
}
So can I help me with the problem???
Reply content:
Hi everyone,
Today I meet a strange problem while the function Openssl_get_publickey () runs well in PHP 7 and report an error in PHP5 . 6.16 and php5.5.12
Here is the test code:
<?php
Define a PEM formatted string varaible named $key
$key = <<<eof
-----BEGIN Public KEY-----
migfma0gcsqgsib3dqebaquaa4gnadcbiqkbgqcnxj/9qwvfgouh/ y2w89l6bkrafljhnhgpdypubv64bfqnn1pjbczkim6qrdkbolpxmkkmifynkd6raoprih3/prqeb/vsw8oom8fxn67udyuybtqa23mml9q1+ Ilizwbc2aq2ubvorfxffl75p6/b5ksing9zpgmlcuyulkxplqidaqab
-----END Public KEY-----
EOF;
Get the public key
$res = Openssl_get_publickey ($key);
Var_dump ($res);
?>
While in php7.0.0 the result is normal and correct the output
{
D:\wamp64\www\php\index.php (): eval () ' D code:24:resource (4, OpenSSL key)
}
But isn't the same result in PHP 5.6.16 and PHP 5.5.12 This is the output
{
D:\wamp64\www\php\index.php (): eval () ' d Code:24:boolean false
}
So can I help me with the problem???