I have only recently been introduced to curl and am working on a certain php script in Unix which runs curl to check the state of one of our monitoring systems. Sorry if what I ask is silly.
Basically, I wonder if the Exit Codes can be quickly translated to what they mean, as is described in this page (scroll down to exit codes). Is there a unix or php command to which I can send the curl exit code? Basically it would be ideal if the output of my script could translate the curl exit codes on the fly so that the user would know exactly what went wrong without having to look up the exit code on the internet.
Many thanks!
Sure, it’s called
curl_error()– although the wording of your question almost suggests that you areexec()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…