mac os php intratactive模式没有提示 [英] mac os php intratactive mode has no prompt

查看:106
本文介绍了mac os php intratactive模式没有提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从终端窗口以及当我运行命令

I'm trying to run PHP in interactive mode from the terminal window and when i run the command

  php -a

它说启用了交互模式",但没有显示应该显示的"php->"提示.我必须按Control z才能退出交互模式,但是在启用"交互模式时我可以执行任何命令

it says "Interactive mode enabled" but does not show me the "php->" prompt that it should. I have to press control z to get out of interactive mode but I can execute any commands while interactive mode is "enabled"

有人知道如何解决此问题

Does anyone know how to fix this

推荐答案

PHP交互式shell要求将GNU readline或libedit静态编译为PHP二进制文件.许多发行版仅提供仅包含readline扩展名的共享库.

The PHP interactive shell requires that GNU readline or libedit is compiled statically into the PHP binary. Many distributions only provide shared libraries containing only the readline extension.

如果您自己编译PHP,

If you compile PHP yourself do

./configure --with-readline

./configure --with-libedit

(请注意,由于GPl和PHP许可证之间的不兼容性,您可能可能不会重新分发链接到readline的PHP二进制文件,因此您必须使用libedit,但我怀疑您仍然想重新分发PHP本身.当然可以.这对您的基于PHP的应用程序无关紧要,但这是为什么对大多数发行版不起作用的原因之一...)

(note that you, probably, may not redistribute PHP binaries linked to readline due to incompatibilities between GPl and the PHP license, you'd have to use libedit then, but I doubt you want to redistribute PHP itself anyways. Usage is certainly ok. This doesn't matter for your PHP-base applications. But this is one of the reasons why this doesn't work for most distros ...)

我刚刚提交了一个PHP错误,以通过共享版本启用readline模式,也许我也有时间实施它:

I just filed a PHP bug to enable readline mode with a shared build, too, maybe i find time to implement it: http://bugs.php.net/bug.php?id=53878

这篇关于mac os php intratactive模式没有提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆