0

我最近才被介绍给 curl 并且正在编写 Unix 中的某个 php 脚本,该脚本运行 curl 来检查我们的一个监控系统的状态。对不起,如果我问的是愚蠢的。

基本上,我想知道退出代码是否可以快速翻译成它们的意思,如本页所述(向下滚动到退出代码)。是否有我可以向其发送 curl 退出代码的 unix 或 php 命令?基本上,如果我的脚本的输出可以即时翻译 curl 退出代码,这样用户就可以确切地知道出了什么问题,而无需在 Internet 上查找退出代码。

非常感谢!

4

1 回答 1

3

Sure, it's called curl_error() - although the wording of your question almost suggests that you are exec()ing the command line cURL binary - is that the case? Because you really should be using the PHP extension, it is available as standard on most installation these days...

于 2012-04-05T14:08:17.067 回答