It is a shame that Debian's PHP does not include the readline extension, for a licencing problem.

Fortunately, it is very easy to replace readline with libedit (tested on debian6 (squeeze)). Here is how: