5

This line of PHP code:

$oauthClient = new OAuth($consumerKey, $consumerSecret, ... etc.

Results in error:

Fatal error: Class 'OAuth' not found

I'm running WampServer 2.1, PHP version 5.3.4, Windows Server 2008 R2 (equivalent to Windows 7)

I've double checked that php_oauth.dll is installed as per these instructions: PHP OAUTH class api

How do I successfully load the oauth extension and fix this PHP error?

5
  • 1
    Do Apache throws any errors when it starts? Search in logs. Commented Aug 17, 2012 at 6:42
  • I would suggest you to check the files php.ini you updated ; there are 2 files ; one used for command line one for http access Commented Aug 17, 2012 at 8:49
  • Good point. In the Apache logs: c:/wamp/bin/php/php5.3.4/ext/php_oauth.dll' - %1 is not a valid Win32 application I've tried both oauth dlls here: downloads.php.net/pierre Where can I find a valid Win32 dll? Version Apache/2.2.17 (Win32) Commented Aug 17, 2012 at 15:27
  • It appears as though I'm running 64bit WAMP Server and suspect that there's no oauth 64bit compatible dll. Could not find an easy way to determine if WAMP installed is 64 vs 32. Ended up opening .exe files in a hex editor. Is there a way to compile the oauth extension for 64 bit? Commented Aug 17, 2012 at 16:37
  • The exact oauth 64bit extension question was just asked here: stackoverflow.com/questions/12000575/… Commented Aug 17, 2012 at 16:42

2 Answers 2

10

Download the correct oauth DLL from here

Paste php_oauth.dll in \wamp\bin\php\php5.5.12\ext

Add these line your both php.ini extension=php_oauth.dll

1.\wamp\bin\php\php5.5.12
2.\wamp\bin\apache\apache2.4.9\bin
Sign up to request clarification or add additional context in comments.

2 Comments

The answer that allows phpinfo() on Windows list oAuth module in the list.
update: in WAMP 3.0.4 to set php.ini in PHP settings is enough. Then you need to restart WAMPP to see the extension.
0

This is because you don't enabled php_OAuth.dll

For that you first need to enable

You can find stepwise instructions for windows from here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.