hi everyone,
”扩展PHP“说起来容易做起来难。PHP已经进化成一个日趋成熟的源码包几十兆大小的工具。要骇客如此复杂的一个系统,不得不学习和思考。构建本章内容时,我们最终选择了“在实战中学习”的方式。这不是最科学也不是最专业的方式,但是此方式最有趣,也得出了最好的最终结果。下面的部分,你将先快速的学习到,如何获得最基本的扩展,且这些扩展立即就可运行。然后你将学习到 Zend 的高级 API 功能,这种方式将不得
392
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:
<?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);
立即学习“PHP免费学习笔记(深入)”;
?>
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???
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:
<?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);
立即学习“PHP免费学习笔记(深入)”;
?>
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???
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号