简体   繁体   中英

Error Fatal error: Class 'Oauth' not found when using OAuth

I using code demo from link http://djpate.com

When I run http://localhost:8080/test/OAuthProviderExample/client/index.php is it get error Fatal error: Class 'Oauth' not found in C:\\wamp\\www\\test\\OAuthProviderExample\\client\\index.php on line 2

in client/index.php i using:

$oauth_client = new Oauth("key","secret"); // line 2
$oauth_client->enableDebug();

How to fix it, i using wampserver in windows 7

I had this same problem. I think wamp installs using win32 bits by default. Even if you are running windows 64bit OS. So download the 86x version here For PHP version 5.5 .
Extract the Zip file and copy the php_oauth.dll found in your extract to C:\\wamp\\bin\\php\\php5.5.12\\ext Click on your wamp server, goto > , add this extension=php_oauth.dll to a place where you find similar text or anywhere. > ,添加此extension=php_oauth.dll到您可以在任何地方找到相似文字的地方。 Now exit your wamp server. Start it up again and in > you should see php_oauth ticked. > 你应该看到php_oauth。 However, if you still encounter problems goto PHP error logto get a clue. Cheers!

remember there's one step in the tutorial:

sudo pecl install oauth

This is installing the oauth lib, in Windows OS it should be "oauth.dll" liked file, check where to get the lib file for Windows. and see if the problem solved.

Oauth for PHP 5.4 Windows x86

PHP/5.4.7 http://zahymaka.com/314/php-5-4-oauth-x86-windows

This is not my source so im not sure how stable ,but it was the only option I've found after about an hour and a half of searching.

Throw the file into your php/ext folder

Edit your php.ini to include the extension

extension=php_oauth.dll

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM