Installing the Pecl Oauth Module on MAMP OSX 10.6
Asked Answered
S

4

0

Ok, so after a day of messing about with various things such as Fink, Macports, Pecl, etc. I have managed to install the oauth.so module on OSX.

However, I use MAMP locally, which I think uses its own version (i.e. in its own location) of PHP, and the module has installed to the main system version of PHP?

So I have run the version of PECL from the MAMP folders:

sudo /Applications/MAMP/bin/php5.2/bin/pecl install oauth

But it seems to have installed it in the generic folder anyway

    ...
    Build process completed successfully
    Installing '/usr/lib/php/extensions/no-debug-non-zts-20090626/oauth.so'
    install ok: channel://pecl.php.net/oauth-1.0.0
    configuration option "php_ini" is not set to php.ini location
    You should add "extension=oauth.so" to php.ini

Note the /usr/lib/... folder. But the php.ini MAMP is using, actually looks in /Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20060613

I thought it would be as easy as just copying the .so file over... but that was hoping for too much..

Can anyone help me, how can I install this extension in the correct folder and let php know about it??

Thanks

Sorcerer answered 10/11, 2010 at 14:59 Comment(0)
X
4

I'm running MAMP Version 1.9.6 on Mac OSX Version 10.7.4 and had the same problem.

I checked my MAMP php error logs at /Applications/MAMP/logs/php_error.log

and found this error

[22-Jul-2012 12:11:20] PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/oauth.so' - dlopen(/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/oauth.so, 9): no suitable image found.  Did find:
        /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/oauth.so: mach-o, but wrong architecture in Unknown on line 0

I fixed it with the following:

  1. Download source from http://pecl.php.net/package/oauth

    Open up a terminal, navigate to where your downloaded file is and type the following commands:

  2. tar xzvf oauth-1.1.0.tgz

  3. cd oauth-1.2.2/oauth-1.2.2

  4. phpize

  5. sudo ./configure MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS="-arch i386 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch i386 -g -Os -pipe" CXXFLAGS="-arch i386 -g -Os -pipe" LDFLAGS="-arch i386 -bind_at_load"

    NOTE: Make sure you type the right version number of your Mac OSX for the TARGET in the above command.

  6. sudo make

  7. sudo make install

  8. sudo cp /usr/lib/php/extensions/no-debug-non-zts-20090626/oauth.so /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/oauth.so

  9. In your favorite editor, open up php.ini (in my case its located at /Applications/MAMP/conf/php5.3/php.ini) and add the following line in the extensions area:

    extension=oauth.so

  10. Save your changes and restart MAMP. You should see an oauth entry in the MAMP PHPINFO page.

Xanthippe answered 22/7, 2012 at 20:32 Comment(1)
Thanks a lot for this! I wish I had found it earlier :)Resolved
O
0

You should set the php_ini setting of pecl to point to the php.ini of your MAMP installation. So:

sudo /Applications/MAMP/bin/php5.2/bin/pecl config-set /Applications/MAMP/conf/php.ini

This should make pecl use your current MAMP php configuration

Octavalent answered 18/4, 2011 at 18:42 Comment(1)
config-set expects 2 or 3 parameters??Indicatory
V
0

PECL Modules are compiled modules, in order to install them, you need the PHP headers. You can found the headers on php.net/downloads.php make sure you download a version which match with your PHP version. Then you can follow this : Installing PHP OAuth in MAMP environment

Violence answered 18/6, 2014 at 0:15 Comment(0)
G
0
sudo /Applications/MAMP/bin/php/php7.4.12/bin/pear install HTTP_OAuth-0.3.2

use the above command to install Oauth libraries in MAMP

And then You should add "extension=oauth.so" to php.ini

Restart Server After Add extension in php.ini file

Gerbold answered 25/6, 2021 at 4:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.