cURL error when Integrating the PHP SDK on my project

  • 1
  • Problem
  • Updated 2 years ago
  • Solved

I am Using RingCentral Connect Platform PHP SDK ( to send fax messages, I get a curl error when i run the script. I have a developer account and testing the authenticate and Fax message and it works fine.

Error details:
Warning: curl_close(): 28 is not a valid cURL handle resource in <path_to_project>\vendor\ringcentral\ringcentral-php\src\Http\Client.php on line 104

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Invalid response string' in vendor\ringcentral\psr7\src\functions.php:478
Stack trace:
#0 <path_to_project>\vendor\ringcentral\ringcentral-php\src\Http\ApiResponse.php(56): RingCentral\Psr7\parse_response('HTTP/1.1 0 OK??')
#1 <path_to_project>\vendor\ringcentral\ringcentral-php\src\Http\Client.php(99): RingCentral\SDK\Http\ApiResponse->__construct(Object(RingCentral\Psr7\Request), false, 0)
#2 <path_to_project>\vendor\ringcentral\ringcentral-php\src\Http\Client.php(25): RingCentral\SDK\Http\Client->loadResponse(Object(RingCentral\Psr7\Request))
#3 <path_to_project>\vendor\ringcentral\ringcentral-php\src\Platform\Platform.php(214): RingCentral\SDK\Http\Client->send(Object(RingCentral\Psr7\Request))
#4 <path_to_project>\vendor\ringcentral\ringcentral-php\src\Platform\Platform.php(301): RingCentral\SDK\Platform\Platform->sendReq in C:\inetpub\wwwroot\erexpress\public\vendor\ringcentral\ringcentral-php\src\Http\Client.php on line 44

Sample code (basically the sample code from -

use RingCentral\SDK\SDK;


$credentials = require(__DIR__ . '/vendor/ringcentral/ringcentral-php/demo/_credentials.php');

// Authorize
$platform->login($credentials['username'], $credentials['extension'], $credentials['password']);

// Find Fax-enabled phone number that belongs to extension
$phoneNumbers = $platform->get('/account/~/extension/~/phone-number', array('perPage' => 'max'))
print 'Fax Phone Number: ' . $credentials['username'] . PHP_EOL;

// Send Fax
$request = $rcsdk->createMultipartBuilder()
                     'to'         => array(
                         array('phoneNumber' => $credentials['username']),
                     'faxResolution' => 'High',
                 ->add('Plain Text', 'file.txt')
                 ->add(fopen('', 'r'))

//print $request->getBody() . PHP_EOL;

$response = $platform->sendRequest($request);

print 'Sent Fax ' . $response->json()->uri . PHP_EOL;
Photo of ER Express Fax

ER Express Fax

  • 242 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of ER Express Fax

ER Express Fax

  • 242 Points 100 badge 2x thumb
Official Response
Hi Anil, 

We have resolved the issue we came across while trying to integrate Ringcentral PHP SDK. The issue was caused due to cURL SSL certificate issue.

Curl error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed. Copied cacert.pem file and modified php.ini with the path to cacert.pem and it works.

Thank you for your support.