首页 / PHP / PHP远程调用API500报错解决方案
PHP远程调用API500报错解决方案
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了PHP远程调用API500报错解决方案,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1058字,纯文字阅读大概需要2分钟。
内容图文
![PHP远程调用API500报错解决方案](/upload/InfoBanner/zyjiaocheng/225/19d7dae1f64b4329aef88f32f3092981.jpg)
function getInventory($code) {
$req = new InventoryGetRequest();
$req -> setProductCode($code);
$client = new DefaultSuningClient(SERVER_URL, APP_KEY, APP_SECRET, FORMAT);
$resp = $client -> execute($req);
$response = json_decode($resp, true)['sn_responseContent'];
if (isset($response['sn_error'])) {
return false;
} else {
return $response['sn_body']['inventory']['invNum'];
}
}
写一个函数远程调用对方API ,在记录数少的时候 比如100左右,运行正常,记录数多的话 比如3000以上就报 500错误
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
初步在想是不是远程API响应超时造成的,水平有限,不会一一排查,请大帅可以指点迷津。
------解决思路----------------------
目标网站问题,和你的代码没有关系。
内容总结
以上是互联网集市为您收集整理的PHP远程调用API500报错解决方案全部内容,希望文章能够帮你解决PHP远程调用API500报错解决方案所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。