0

我已经安装了 sphinx 二进制文件和库,现在正在尝试安装 PECL sphinx 模块。

我的系统正在运行安装了 MAMP 1.8.2 的 OS X 10.6。我尝试使用以下命令安装 sphinx:

sudo pecl install sphinx

PECL 命令输出以下内容:

running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

上面的版本与执行phpinfo(). 似乎 PECL 正试图遵守 PHP 的内置版本。

如果我忽略错误并继续,它将成功编译并将sphinx.so文件放入:

/usr/lib/php/extensions/no-debug-non-zts-20090626/sphinx.so

事实上它应该是:

/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/

我尝试将 sphinx.so 文件复制到 MAMP 扩展目录,但是当我重新启动 apache PHP 时会显示以下警告:

PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/sphinx.so

我认为这是因为 MAMP 是 32 位的,而内置的 PHP 是 64 位的,所以 PECL 符合 64 位。我可能完全错了,但当我仔细研究这个话题时,我确实读到了这篇文章。

有谁知道如何让 PECL 映射到 PHP 的 MAMP 版本而不是内置版本?

4

1 回答 1

2

如果 PHP 的“正确”版本安装在类似的目录/Applications/MAMP/bin/php5/中,并且包含开发工具,那么您应该有一些版本的pecl命令来配合它,一些在那个目录旁边。

If so, running that pecl command that corresponds to your "correct" version of PHP should help : it'll run the correct version of phpize, and will allow the extension to be compiled against the (once again) correct version of PHP.

You just have to hope that MAMP includes those commands -- I cannot check, as I don't have a mac.

于 2010-03-13T10:45:00.907 回答