在 MAMP OSX 10.6 上安装 Pecl Oauth 模块
好吧,经过一天的折腾,比如 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
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
使用上面的命令在MAMP中安装Oauth库
然后你应该添加“extension=oauth.so”到php.ini
在php.ini文件中添加扩展后重新启动服务器
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
我在 Mac OSX 版本 10.7.4 上运行 MAMP 版本 1.9.6 并遇到了同样的问题。
我在
/Applications/MAMP/logs/php_error.log
检查了我的 MAMP php 错误日志,发现了这个错误
,我用以下方法修复了它:
从 http://pecl.php.net/package/oauth
打开终端,导航到下载文件所在的位置并键入以下命令:
tar xzvf oauth-1.1。 0.tgz
cd oauth-1.2.2/oauth-1.2.2
< /p>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 版本号。sudo make
<代码>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
)并在扩展区域添加以下行:
extension=oauth.so
保存更改并重新启动 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
I fixed it with the following:
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:
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"
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
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
Save your changes and restart MAMP. You should see an oauth entry in the MAMP PHPINFO page.
您应该将 pecl 的 php_ini 设置设置为指向 MAMP 安装的 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:
This should make pecl use your current MAMP php configuration