5

I have tried following ALL tutorials out there on getting PHP OAuth extension installed under the MAMP environment, but can't get it to load for some reason.

I am using MAMP 1.9 with PHP 5.3.2

The most recent tutorial I was following was: http://lifeofadev.com/2011/03/09/mac-os-x-installing-oauth-so-into-xampp-mamp/

Does anyone else have experience with getting this to work?

Thanks! Dennis

dennismonsewicz
  • 25,132
  • 33
  • 116
  • 189
  • If you are using MAMP PRO, it looks like adding OAuth to PHP can now be done via checking the "OAuth" option in PHP language extensions. See: https://documentation.mamp.info/en/MAMP-PRO-Mac/Languages/PHP/index.html Not sure what version this was added, but I'm using MAMP PRO 6.4. – Darren May 07 '22 at 09:34

3 Answers3

17

After upgrading to MAMP 2.0 for PHP 5.2.17 I followed these steps to install the oauth module through pecl

  1. Download MAMP Server components and libraries Specifically you want php-5.2.17.tar.gz
  2. Uncompress php-5.2.17.tar.gz to /Applications/MAMP/bin/php/php5.2.17/include/php
  3. Run configure against the downloaded php. Do not build it.

    cd /Applications/MAMP/bin/php/php5.2.17/include/php; ./configure

  4. Remove broken pear config:

    mv /Applications/MAMP/bin/php/php5.2.17/conf/pear.conf /Applications/MAMP/bin/php/php5.2.17/conf/pear.conf.bak

  5. Compile oauth

    cd /Applications/MAMP/bin/php/php5.2.17/bin; ./pecl install oauth

  6. Update php.ini and add extension=oauth.so This can be done in MAMP under File -> Edit Template -> PHP -> PHP 5.2.17 php.ini

Ryan White
  • 1,927
  • 2
  • 19
  • 32
  • This worked perfectly for me :D You're awsome! Followed step by step. The include folder didn't exist so i created it. Moved all the contents of the php-5.2.17 folder from the dmg I downloaded to the include folder and the rest was copy/paste. Thanks! – Spoeken Feb 20 '12 at 15:19
  • 1
    I followed all the steps until step 3. but then terminal says: "zsh: no such file or directory: ./configure" What do I need to do? – Tomi Seus Oct 21 '12 at 10:16
  • I'm tripping up at step 5, `/Applications/MAMP/bin/php/php5.6.10/include/php/Zend/zend.h:51:11: fatal error: 'zend_config.h' file not found` – Nathan Hornby Sep 10 '15 at 16:06
2

For MAMP 3:

  1. Download and install OAuth.

    sudo pecl install oauth
    
  2. Then, go to MAMP, and click on File > Edit Template > PHP > PHP 5.x.x php.ini and add the following line

    extension = oauth.so
    

    Make sure to choose the current running php version (or press CMD+4 to edit MAMP's running php.ini file).

  3. Restart MAMP servers.

Muhammad Reda
  • 26,379
  • 14
  • 93
  • 105
1

Since MAMP 3.0 sources are hard to find but you can download sources from PHP.net, make sure the version match : http://php.net/downloads.php, then follow Ryan instructions.

sonique
  • 4,539
  • 2
  • 30
  • 39