Knowledge Base: Blank response when using PHP and curl

When contacting the API using PHP and curl, your application may receive no response. This is likely due to SSL not being configured on your server or due to curl having no SSL support. Check with your server admin or host to resolve this issue.

Curl will return an error message if it is unable to make an SSL connection. Using the curl_error() function, you can trap and display this error in your code.

In your code, find a section that appears like the following...

$xml = curl_exec($ch);
curl_close($ch);

... and add your error handling between those lines, like so....

$xml = curl_exec($ch);
if (curl_error($ch)) {
    print "ERROR ". curl_error($ch) ."\n<br/>";
}
curl_close($ch);

See the PHP documentation for curl for detailed information on how to use this tool.