Use dotdeb. It's like 1 minute work.
Do only points 1,3,4 (omit 2)
sudo apt-get install php5-readline
To use these functions you must compile the CGI or CLI version of PHP with readline support. You need to configure PHP --with-readline[=DIR] . If you want to use the libedit readline replacement, configure PHP --with-libedit[=DIR] .