在MAMP OSX 10.6上安装Pecl Oauth模块 [英] Installing the Pecl Oauth Module on MAMP OSX 10.6

查看:55
本文介绍了在MAMP OSX 10.6上安装Pecl Oauth模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,所以经过一天的混乱,比如Fink,Macports,Pecl等,我设法在OSX上安装了oauth.so模块.

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.

但是,我在本地使用MAMP,我认为它使用自己的PHP版本(即在其自己的位置),并且该模块已安装到PHP的主系统版本中?

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?

所以我已经从MAMP文件夹中运行了PECL版本:

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

注意/usr/lib/...文件夹. 但是php.ini MAMP正在使用,实际上位于/Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20060613

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

我认为这就像将.so文件复制到...一样容易,但是那希望太多了.

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

任何人都可以帮助我,如何将此扩展安装在正确的文件夹中并让php知道呢?

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

谢谢

推荐答案

我正在Mac OSX版本10.7.4上运行MAMP版本1.9.6,并且有相同的问题.

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

我在/Applications/MAMP/logs/php_error.log检查了我的MAMP php错误日志

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

发现此错误


[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. http://pecl.php.net/package/oauth

打开一个终端,导航到下载文件的位置,然后键入以下命令:

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

tar xzvf oauth-1.1.0.tgz

cd oauth-1.2.2/oauth-1.2.2

phpize

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"

注意::请确保在上述命令中为TARGET输入正确的Mac OSX版本号.

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

sudo make

sudo make install

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

在您喜欢的编辑器中,打开php.ini(在我的情况下,它位于 /Applications/MAMP/conf/php5.3/php.ini) 并在扩展区域中添加以下行:

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

保存更改并重新启动MAMP.您应该在MAMP PHPINFO页面中看到一个oauth条目.

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

这篇关于在MAMP OSX 10.6上安装Pecl Oauth模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆