mac os php intratactive mode has no prompt

后端 未结 3 614
小鲜肉
小鲜肉 2021-01-12 02:50

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

  php -a

it says \"Interactive mode enable

3条回答
  •  情歌与酒
    2021-01-12 03:14

    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.

    If you compile PHP yourself do

    ./configure --with-readline
    

    or

    ./configure --with-libedit
    

    (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 ...)

    Edit: 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

提交回复
热议问题