Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I Have been working around with the magento's REST API's for the first time and when i execute this API in a test file in different project i get the Following error

Fatal error: Class 'OAuth' not found in C:\wamp\www\trunk\test.php on line 15

Tried google around even on the stack overflow with lots of topic but nothing could get me passed through this error. In many of blog in found they ask to install Oauth extension for php. as i am using wamp server for windows i could found some extension and i have installed but doesn't show up in the extension list when i run phpinfo().

Looking forward for help.

Thanks in Advance.

$callbackUrl = "http://localhost/Magento/magento/index.php/oauth_admin.php";
$temporaryCredentialsRequestUrl = "http://localhost/Magento/magento/index.php/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://localhost/Magento/magento/index.php/admin/oAuth_authorize';
$accessTokenRequestUrl = 'http://localhost/Magento/magento/index.php/oauth/token';
$apiUrl = 'http://localhost/Magento/magento/index.php/api/rest';
$consumerKey = 'g4gxxknjl3qaof2px0otrpuw6hv4qxsf';
$consumerSecret = '8dc0dfruqresuwvufby7ttchutj3nyn3';

session_start();
if (!isset($_GET['oauth_token']) && isset($_SESSION['state']) && $_SESSION['state'] == 1) {
$_SESSION['state'] = 0;
}
try {
$authType = ($_SESSION['state'] == 2) ? OAUTH_AUTH_TYPE_AUTHORIZATION : OAUTH_AUTH_TYPE_URI;
$oauthClient = new OAuth($consumerKey, $consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $authType);
$oauthClient->enableDebug();
share|improve this question
 
What's your version of Windows ? And PHP ? –  blmage May 30 at 8:59
 
Windows 7 64bit and PHP 5.3.13. –  Afreen Sheikh May 30 at 9:21
 
Check this link to get OAuth working under Windows 7 (at least it worked for me) : stackoverflow.com/questions/14990747/… –  blmage May 30 at 10:14
 
Oh! dear i have already went through many of the stackoverflow pages, couldn't resolve the issue. Your reference was one amongst the viewed page earlier. Well! what i feel here is that i don't have the class name Oauth in my source i guess i should get one but don't know the right file to get and i have tried getting some files online, which dint help. Looking forward for the reply –  Afreen Sheikh May 30 at 11:16
 
After a long research, found the right Oauth library.. Here is the link.. mediafire.com/download/9iaaw9lv9ckvcm9/… Notice: Most of the libraries will not be working in windows 7 as i have tried with many of them, and dont forget to edit php.ini file and add extension=php_oauth.dll And restart wamp server!! Enjoy.. –  Afreen Sheikh May 30 at 11:35

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.