Using ecommerce commands work fine when I paste them into my browser but fail from inside PHP using curl

If you are using PHP and curl make sure you set CURLOPT_FRESH_CONNECT flag to true so that you force the use of a new connection instead of a cached one.
Check what “curl_exec” returns – is it an empty response or something else?  Call curl_error after you do the curl_exec.  If that doesn’t give any clues, get the response headers from curl to track this further, like so:

curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);

// Then get the headers, after your curl_exec call:
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$header = substr($response, 0, $header_size);
$body = substr($response, $header_size);

If curl_error returns an error message like the following one:

cUrl error (#60): SSL certificate problem, verify that the CA cert is OK.
Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Then force a fresh connection and see if that makes any difference, by setting CURL_OPT_FRESH_CONNECT on curl, like so:

curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);