在 MAMP OSX 10.6 上安装 Pecl Oauth 模块

发布于 2024-10-01 18:00:40 字数 837 浏览 0 评论 0原文

好吧,经过一天的折腾,比如 Fink、Macports、Pecl 等,我已经成功在 OSX 上安装了 oauth.so 模块。

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

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

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

但它似乎已经将其安装在通用文件夹中,

    ...
    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 中查找,

我认为这就像复制 .所以文件结束了...但是希望太多了..

任何人都可以帮助我,我怎样才能在正确的文件夹中安装这个扩展并让 php 知道它?

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

又爬满兰若 2024-10-08 18:00:41

PECL 模块是已编译的模块,为了安装它们,您需要 PHP 标头。您可以在 php.net/downloads.php 上找到标头,确保您下载的版本与您的 PHP 版本匹配。然后您可以按照以下步骤操作:在MAMP环境中安装PHP OAuth

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

末蓝 2024-10-08 18:00:41
sudo /Applications/MAMP/bin/php/php7.4.12/bin/pear install HTTP_OAuth-0.3.2

使用上面的命令在MAMP中安装Oauth库

然后你应该添加“extension=oauth.so”到php.ini

在php.ini文件中添加扩展后重新启动服务器

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

何以笙箫默 2024-10-08 18:00:40

我在 Mac OSX 版本 10.7.4 上运行 MAMP 版本 1.9.6 并遇到了同样的问题。

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

,发现了这个错误

[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

,我用以下方法修复了它:

  1. http://pecl.php.net/package/oauth

    打开终端,导航到下载文件所在的位置并键入以下命令:

  2. tar xzvf oauth-1.1。 0.tgz

  3. cd oauth-1.2.2/oauth-1.2.2< /p>

  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"

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

  6. sudo make

  7. sudo make

  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. 在您最喜欢的编辑器中,打开php.ini(就我而言,它位于
    /Applications/MAMP/conf/php5.3/php.ini
    并在扩展区域添加以下行:

    extension=oauth.so

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

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.

羞稚 2024-10-08 18:00:40

您应该将 pecl 的 php_ini 设置设置为指向 MAMP 安装的 php.ini。所以:

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

这应该使 pecl 使用您当前的 MAMP php 配置

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文