Cannot get Oauth PHP extension to work

I am pulling my hair out trying to travel with PHP, using PHP.

I am using MAC_OSX_10.7.4 / MAMP / PHP and I am pointing to php inside my MAMP environment.

I downloaded the latest oAuth php 1.2.2 extension.

I launched:

pecl install oauth

Which returned successfully when I try to reinstall it, I get:

pecl/oauth is already installed and is the same as the released version 1.2.2

I added the line:

extension=oauth.so

in my php.ini. but whenever I try to run this simple bit of code to check oauth:

    <?php

define("CONSUMER_KEY", "dgqcifzjqksh");
define("CONSUMER_SECRET", "73Ft6jKqe3A7sCsc");

$oauth = new OAuth(CONSUMER_KEY, CONSUMER_SECRET);

echo "oauth token" . $oauth;
$request_token_response = $oauth->getRequestToken('https://api.linkedin.com/uas/oauth/requestToken');

if($request_token_response === FALSE) {
        throw new Exception("Failed fetching request token, response was: " . $oauth->getLastResponse());
} else {
        $request_token = $request_token_response;
}

print "Request Token:\n";
printf("    - oauth_token        = %s\n", $request_token['oauth_token']);
printf("    - oauth_token_secret = %s\n", $request_token['oauth_token_secret']);
print "\n";

?>

I get the following error in my php logs

PHP Fatal error:  Class 'OAuth' not found in /Applications/MAMP/htdocs/wemustcreate/wp-content/themes/MinimalDessign/linkedinOauth.php on line 6

Any ideas what I can do wrong? I checked php.ini and it does not appear there. I even deleted existing extensions and added them to make sure php.ini was updated correctly.

, , , - , , .so, - unix, oauth . ? , .

oauth.so as a document

+5
1

, php, .

, , "OAuth":

php -m

, ".ini" ,

/etc/php5/conf.d/

, :

/etc/php5/cli/conf.d/

apache.

+3

All Articles