Fatal error: Call to undefined method
Tags: sdk
Mar 21, 2016 at 8:03am • 6 replies • 0 likes
james.odonnell
Hi, I'm having a little dive into the PHP SDK and having followed the guidance on GitHub I'm getting...
"Fatal error: Call to undefined method RingCentral\SDK\SDK::getPlatform()"
When using: $sdk->getPlatform()->login('USERNAME', 'EXT', 'PASS');
If I use: $sdk->platform()->login('USERNAME', 'EXT', 'PASS');
I get "curl_close(): 52 is not a valid cURL handle resource in phar:"
Any ideas why I can't even validate and login?
Thanks
James
6 Answers
Yes, I too have had issues with self-signed certificates. If you just need a quick place to test that is not on your local machine, you can use Heroku (they support PHP) since the URL they provide you has a valid certificate chain available. Azure and GCP may also provide this feature, but I've not tested in those environments.
0
Hi PHP version is 5.5.9 cURL is 7.30.0...
I've now got it working, it seems to be a problem with the test server having a self signed certificate, I was using $sdk->getPlatform()->login('USERNAME', 'EXT', 'PASS'); as its what was originally detailed on the github page...
Thanks
James
I've now got it working, it seems to be a problem with the test server having a self signed certificate, I was using $sdk->getPlatform()->login('USERNAME', 'EXT', 'PASS'); as its what was originally detailed on the github page...
Thanks
James
0
Hi James,
To authenticate the user you should be using :
For a simpler understanding, take a look at the "develop" branch on our official PHP-SDK repository on github titled "How to Demo" once you have installed the SDK using either composer/PHAR:
https://github.com/ringcentral/ringcentral-php/tree/develop#how-to-demo
To authenticate the user you should be using :
$sdk->platform()->login('USERNAME', 'EXT', 'PASS');Do you have composer installed ? If so, have you provided the appropriate path for the composer's autoloader.
For a simpler understanding, take a look at the "develop" branch on our official PHP-SDK repository on github titled "How to Demo" once you have installed the SDK using either composer/PHAR:
https://github.com/ringcentral/ringcentral-php/tree/develop#how-to-demo
0
Yes cURL is working fine, even testing with the following script.
Thanks
James
<?php
// Script to test if the CURL extension is installed on this server
// Define function to test
function _is_curl_installed() {
if (in_array ('curl', get_loaded_extensions())) {
return true;
}
else {
return false;
}
}
// Ouput text to user based on test
if (_is_curl_installed()) {
echo "cURL is <span style=\"color:blue\">installed</span> on this server";
} else {
echo "cURL is NOT <span style=\"color:red\">installed</span> on this server";
}
?>Gives the following "cURL is installed on this server".
Thanks
James
0
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder