Hieveryone, todayimeetastrangeproblemwhilethefunctionopenssl_get_publickey () runswellinphp7whilereportanerrorinphp5.6.16andphp5.5.12hereisthetestcode: & amp; lt ;? Phpdefinea... hi everyone,
Today I meet a strange problem while the function openssl_get_publickey () runs well in php 7 while report an error in php5. 6.16 and php5.5.12
Here is the test code:
// Define a pem formatted string varaible named $ key
$ Key = < ----- Begin public key -----
Pushed/9 qwVfgoUh/pushed/PrQEB/pushed + 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 here is the output
{
D:\wamp64\www\php\index.php(50) : eval()'d code:24:resource(4, OpenSSL key)
}
But not the same result in php 5.6.16 and php 5.5.12 here is the output
{
D:\wamp64\www\php\index.php(50) : eval()'d code:24:boolean false
}
So can you 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 while report an error in php5. 6.16 and php5.5.12
Here is the test code:
// Define a pem formatted string varaible named $ key
$ Key = < ----- Begin public key -----
Pushed/9 qwVfgoUh/pushed/PrQEB/pushed + 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 here is the output
{
D:\wamp64\www\php\index.php(50) : eval()'d code:24:resource(4, OpenSSL key)
}
But not the same result in php 5.6.16 and php 5.5.12 here is the output
{
D:\wamp64\www\php\index.php(50) : eval()'d code:24:boolean false
}
So can you help me with the problem ???