安装 PHP 的 PECL sphinx 模块时出现问题

发布于 2024-08-25 04:27:24 字数 1023 浏览 2 评论 0原文

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

我的系统运行的是 OS X 10.6,安装了 MAMP 1.8.2。我尝试使用以下命令安装 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 loaddynamic library '/Applications/MAMP/bin/php5/lib/php/extensions/no -debug-non-zts-20060613/sphinx.so

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

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

I've installed the sphinx binaries and libraries and am now trying to install the PECL sphinx module.

My system is running OS X 10.6 with MAMP 1.8.2 installed. I try to install sphinx using the following command:

sudo pecl install sphinx

The PECL command outputs the following:

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

The versions above don't match the versions listed when doing a phpinfo(). It seems that PECL is trying to complie against the built-in version of PHP.

If I ignore the errors and continue the it will successfully compile and place the sphinx.so file in:

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

when in fact it should be:

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

I've tried copying the sphinx.so file to the MAMP extensions dir but when I restart apache PHP displays the following warning:

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

I think this is because MAMP is 32bit and the built-in PHP is 64bit so PECL complies for 64bit. I might be completely wrong but I did read this when I goggled on the topic.

Does anyone know how to get PECL to map to the MAMP version of PHP instead of the built-in version?

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

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

发布评论

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

评论(1

满地尘埃落定 2024-09-01 04:27:24

如果“正确”版本的 PHP 安装在 /Applications/MAMP/bin/php5/ 之类的位置,并且包含开发工具,那么您应该拥有某个版本的 PHP与之配套的 pecl 命令,有些位于该目录旁边。

如果是这样,运行与您的“正确”PHP 版本对应的 pecl 命令应该会有所帮助:它将运行正确版本的 < code>phpize,并将允许针对(再次)正确的 PHP 版本编译扩展。

你只需要希望 MAMP 包含这些命令--我无法检查,因为我没有 Mac。

If the "correct" version of PHP is installed in something like /Applications/MAMP/bin/php5/, and has the development tools included, you should have some version of the pecl command to go with it, some next to that directory.

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.

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