Home >Backend Development >PHP Tutorial >openssl_get_publickey返回false

openssl_get_publickey返回false

PHP中文网
PHP中文网Original
2017-03-31 16:13:373284browse

1355.png

1356.png

1357.png

这3种公钥的方式都试过了

$pubKey = file_get_contents($public_key_path); 
$res = openssl_get_publickey($pubKey); 
var_dump($res);

但是打印出来就是false 

回复内容:

cn2.php.net/manual/zh/function.openssl-pkey-get-public.php

第二种是传递文件名,如果都不行,肯定就不行啦

我知道了   其实公钥是不能放在一行写的,要用原来demo里的,支付宝还告诉我一定要放在一行写,坑爹啊

一行书写,在windows下是正常的,在linux下返回false

 以上就是openssl_get_publickey返回false的内容,更多相关内容请关注PHP中文网(www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn