PHP cURL调用在Ubuntu 14.05中使用PHP 5.5.9,但在使用PHP 5.3的Ubuntu 12.04上不起作用

I am having a problem calling cURL with php in my production server(Ubuntu 12.04, PHP 5.3).

It works on my localhost (Ubuntu 14.04, PHP 5.5.9)

This is the function which makes the cURL call.

public function callSendGrid($url,$method,$request_body = null)
{ 

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_HTTPHEADER, ["authorization: Bearer ".$this->sendGridApiKey]);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    if($request_body)
        curl_setopt($ch, CURLOPT_POSTFIELDS,$request_body);

    switch($method){
        case 'PUT':
        case 'DELETE':
        case 'PATCH':
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
        break;
        case 'POST':
            curl_setopt($ch, CURLOPT_POST, 1);
        break;
        case 'GET':
            curl_setopt($ch, CURLOPT_HTTPGET, 1);
        break;
    }

    $response = json_decode(curl_exec($ch));
    $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    return ['status' => $http_status,'response' => $response];
}

I call it like

$this->Model->callSendGrid('https://api.sendgrid.com/v3/campaigns/123123/schedules/now', 'POST');

It works on my local environment, but doesnt work on my production environment.

On my local environment, it returns

['status' => 201, 'response' => *a json decoded response*]

On my production environment, it returns

['status' => 400, 'response' => *absolutely nothing here*]

Its worth mention that some other calls work;

This call worked on both environments:

$this->Model->callSendGrid('https://api.sendgrid.com/v3/campaigns/', 'POST', 'a json that the api accepts');

I just cant see any difference between the two calls, except that the first one has no post data. But it shouldnt make it fail in one environment and work in another.

I am updating my production environment to match my local environment, but i didnt see any issues in cURL with PHP 5.3;

Im hoping you guys can help me. Its very odd to see the exact same call work in my local environment and dont work on my production environment, while other calls work on both environments. Its not a problem with the API that im making the call, since it works on local. I already have dumped the curl_response without json_decode it, it returns a BAD REQUEST on production environment.

Im really getting crazy here guys.

Thanks