Fatal error: Class ‘OAuth’ not found in /home/vhosts/*/test.PHP on
line 8
我在000WebHost上使用免费服务器,我读过免费服务器有时不支持OAuth.我已经在另一个免费服务器上尝试过,我得到了相同的错误消息,所以我的问题是如何检查服务器是否支持使用OAuth?
这是我的代码:
// Fill the keys and secrets you retrieved after registering your app $oauth = new OAuth("abcd123456","efgh987654"); $oauth->setToken("abcd1234-efgh987-9988","9876abcd-123asdf-1122"); $params = array(); $headers = array(); $method = OAUTH_HTTP_METHOD_GET; // Specify LinkedIn API endpoint to retrieve your own profile $url = "http://api.linkedin.com/v1/people/~"; // By default,the LinkedIn API responses are in XML format. If you prefer JSON,simply specify the format in your call // $url = "http://api.linkedin.com/v1/people/~?format=json"; // Make call to LinkedIn to retrieve your own profile $oauth->fetch($url,$params,$method,$headers); echo $oauth->getLastResponse();
这些密钥只是替换为LikedIn Developers入门指南中的密钥.
预先感谢您的帮助.