sto cercando di connettersi alle API LinkedIn, ma ogni volta che cerco di accedervi ottengo il seguente errore:Fatal error: Class 'OAuth' non trovato in
Fatal error: Class 'OAuth' not found in /home/vhosts/*/test.php on line 8
sto usando un server gratuito su 000WebHost e ho letto che i server gratuiti a volte non supportano OAuth. L'ho provato su un altro server gratuito e ottengo lo stesso messaggio di errore, quindi la mia domanda è: come posso verificare se il server supporta l'uso di OAuth?
Ecco il mio codice:
// 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();
I tasti sono solo sostituiti con quelli sul LikedIn sviluppatori Guida introduttiva.
Grazie in anticipo per il vostro aiuto.
Sono d'accordo che usare l'estensione PECL è il modo migliore, ma nell'hosting condiviso è un problema. Quindi scegli la soluzione appropriata per te. –