The PHP interactive shell requires GNU readline or libedit to be statically placed in the PHP binary. Many distributions provide only shared libraries containing only the readline extension.
If you compile PHP yourself,
./configure --with-readline
or
./configure --with-libedit
(note that you may not be able to redistribute the PHP binaries associated with readline due to incompatibility between the GPl and the PHP license, then you will have to use libedit, but I doubt you want to redistribute PHP anyway. of course, this ok, that doesn't matter for your PHP base applications, but that's one of the reasons why this doesn't work for most distributions ...)
Edit: I just logged a PHP error to enable readline mode along with the general assembly, maybe I take the time to implement it: http://bugs.php.net/bug.php?id=53878
johannes
source share