Installing PHP OAuth in MAMP environment

旧时模样 提交于 2019-12-18 03:45:35

问题


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


回答1:


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




回答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.




回答3:


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.




回答4:


First step is giving us some info on why it isn't working. Make a page with phpinfo(), make sure oauth isn't there.

You're going to want to stop apache and start it again. Then check the error log. If you've added it to your extension directory and set up your php.ini then it should be reporting to the error log regarding why the extension isn't loading.



来源:https://stackoverflow.com/questions/5413380/installing-php-oauth-in-mamp-environment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!