The running result of openssl_get_publickey () is different on php7 and php5.6 ????

Source: Internet
Author: User
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 ???

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.