配置已安装的 PHP 以使用已安装的 ncurses (MAMP)
我已经安装了 MAMP,但它附带的 PHP 不是用 ncurses 编译的。 我尝试使用端口来安装ncurses,它似乎已经存在于我的系统上,所以现在我想知道是否有办法让PHP使用它无需重新编译 PHP --with-ncurses 。
换句话说:PHP 可以配置为使用 ncurses 而无需重新编译吗?
I have installed MAMP and the PHP it came with wasn't compiled with ncurses. I've tried to use port to install ncurses and it seems that it already exists on my system so now I was wondering if there was a way to get PHP to use it without having to recompile PHP --with-ncurses.
In other words: Can PHP be configured to use ncurses without the recompilation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据手册,必须编译ncurses。一些扩展可以可以编译为共享库(dll/so)并动态加载,但有些不能。 看来 ncurses 不能。
我不太了解 mac 软件包的结构,但这不是 bsd/ports 风格的安装吗? 在这种情况下,只需找到该包并配置+重新编译它即可。
编辑:我看到 mamp 是一个二进制发行版。 那你就不走运了。 我建议你至少从源安装 php。 能够安装新的扩展等非常有用。编译 php 相当简单,所以即使您对编译东西不完全有信心,您也应该能够通过它。
According to the manual, ncurses must be compiled in. Some extensions can be compiled as shared libraries (dll/so) and loaded dynamically, but some can't. Seems that ncurses can't.
I don't know a lot about how mac packages are structured, but isn't it a bsd/ports style installation? In that case, just find the package and configure + recompile it.
Edit: I see that mamp is a binary distribution. You're out of luck then. I would suggest that you install at least php from sources. It's very useful to be able to install new extensions etc. It's fairly straight forward to compile php, so even if you aren't completely confident with compiling stuff, you should be able to huddle through it.
我很抱歉这么晚才回答,但这实际上可以使用 MAMP 轻松完成。
我在运行 OS X Snow Leopard 的 MacBook 上完成了此操作。
您的 MAMP 目录包含 php 源代码的 tar 文件。 MAMP 版本 1.8.4 附带 php-5.2.11.tar,位于以下位置:/Applications/MAMP/bin/php5/
之后你只需要将 ncurses.so 扩展添加到 MAMP php.ini
这给了我:
您也可以使用 PCNTL 扩展来完成此操作 ;) ;)
干杯!
I'm sorry for the late answer but this can actually be done quite easily with MAMP.
I have done this on my MacBook running OS X Snow Leopard.
Your MAMP directory contains the tar file of the php source code. MAMP version 1.8.4 ships with php-5.2.11.tar located here: /Applications/MAMP/bin/php5/
Afterwards you just need to add the ncurses.so extension to the MAMP php.ini
This gives me:
You can also do this with the PCNTL extension ;) ;)
Cheers!