支付宝支付php的demo或sdk报错 Warning: openssl_sign() [function.openssl-sign]: Unknown signature algorithm. in
最近在做支付宝支付,在本地测试一切正常,上传到服务器就遇到报错:
Warning: openssl_sign() [function.openssl-sign]: Unknown signature algorithm. in
后来查了查,是我的服务器上PHP环境支持openssl_sign()但却不支持 OPENSSL_ALGO_SHA256这样的参数,问了一下大佬,才发现这个参数是在php5.4.8以上版本才支持,低版本的是使用的SHA256,于是乎试了一下,搞定!
报错原因是支付宝的demo中AopClient.php文件里使用到了这样的语句:
if ("RSA2" == $signType) {
openssl_sign($data, $sign, $res,OPENSSL_ALGO_SHA256);
} else {
openssl_sign($data, $sign, $res);
}
解决办法就是把 OPENSSL_ALGO_SHA256 改成 SHA256
if ("RSA2" == $signType) {
openssl_sign($data, $sign, $res,SHA256);
} else {
openssl_sign($data, $sign, $res);
}
注意:这个文件中共有三处,要全部修改好!
非常感谢linux交流群南宁的朋友,还有原著紫石头的文章。
支付宝支付php的demo或sdk报错 Warning: openssl_sign() [function.openssl-sign]: Unknown signature algorithm. in的更多相关文章
- 安装J2EE的SDK报错:could not find the required version of the Java(TM)2 Runtime Environment in '(null)'的解决办法。
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- linux下, 再次遇到使用thinkphp的模板标签时,报错used undefined function \Think\Template\simplexml_load_string() 是因为没有安装 php-xml包
linux下, 使用thinkphp的模板标签,如 eq, gt, volist defined, present , empty等 标签时, 报错: used undefined function ...
- (TODO:)下载图片,报错:warning: could not load any Objective-C class information from the dyld shared cache. This will significantly reduce the quality of type information available.
想使用NSInvocationOperation下载图片,然而并没有下载下来, NSData为nil, 还有报错:(打断点就报错) warning: could not load any Object ...
- ecstore在MySQL5.7下维护报错WARNING:512 @ ALTER IGNORE TABLE
ecstore在MySQL5.7下维护报错WARNING:512 @ ALTER IGNORE TABLE 打开 /app/base/lib/application/dbtable.php , 替换A ...
- Docker报错 WARNING: IPv4 forwarding is disabled. Networking will not work.
问题:创建容器的时候报错WARNING: IPv4 forwarding is disabled. Networking will not work. # docker run -it -p 3000 ...
- robotframework执行用例时,报错selenium.common.exceptions.WebDriverException: Message: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinl
在用robotframework编写移动端测试用例(用chrome浏览器模拟手机浏览器),执行用例时, 报错selenium.common.exceptions.WebDriverException: ...
- 【mysql报错】MySQL5.7.27报错“[Warning] Using a password on the command line interface can be insecure.”
MySQL5.7.27报错“[Warning] Using a password on the command line interface can be insecure.”在命令行使用密码不安全警 ...
- 【PHP】php7.2报错The each() function is deprecated. This message will be suppressed on furthe
php7.2以上 废除了 each()方法,项目中用到的地方会出现以下报错 The each() function is deprecated. This message will be suppre ...
- scp执行报错WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
linux环境执行scp时会遇到报错WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!,如下 [root@subsname home]# scp AAA. ...
随机推荐
- CentOS 7 服务器配置--安装Redis
#下载Redis wget -r -np -nd http://download.redis.io/releases/redis-3.2.8.tar.gz #解压文件 tar zxvf redis-3 ...
- css3中空格和>的区别
A>B 表示选择A元素的所有子B元素. 与A B的区别在于,A B选择所有后代元素,而A>B只选择一代. A+B表示HTML中紧随A的B元素(A与B是同级元素).
- Tomcat去除端口号和项目名(转)
方法一: 在一个项目结束的时候,往往根据需要直接映射到一个IP地址上.此时就需要去除端口和项目名了,在访问的时候.下面根据具体的例子提供一种实现方法. 一.去掉项目名称 把<Context do ...
- RedHat 7 常用命令总结
Linux RedHat 7常用命令总结... ----------------------- 征服Linux从终端开始 ------------------------------------- 在 ...
- find the Nth highest salary(寻找第N高薪水)
Suppose that you are given the following simple database table called Employee that has 2 columns na ...
- php之数组
数组分类: 1.索引数组. 索引值从0开始,依次递增. 2.使用array()函数声明数组 <?php // 1.直接为数组元素赋值即可声明数组 $contact_index[0] = 1; $ ...
- iconfont 字库入门到精通
字库使用必备三步骤 第一步:使用font-face声明字体 @font-face {font-family: 'iconfont'; src: url('iconfont.eot'); /* IE9* ...
- d3.js多个x轴y轴canvas柱状图
最终效果图镇楼: 本文通过三个步骤来介绍d3.js. 1.简单的柱状图: 2.多个x轴的柱状图: 3.多个x轴.y轴的柱状图: 学习心得: d3.js入门相对比较困难,一旦掌握了核心思想,不断熟悉AP ...
- 基于dijkstra算法求地铁站最短路径以及打印出所有的路径
拓展dijkstra算法,实现利用vector存储多条路径: #include <iostream> #include <vector> #include <stack& ...
- 编译安装httpd 2.4
author:JevonWei 版权声明:原创作品 官方网站下载httpd2.4.apr及apr-util的相关软件包,并传输到centos 7系统中的/usr/local/src(apr1.6版本过 ...