PHP 5.4 interactive mode on Ubuntu 12.04

Solution 1:

My PPA (ppa:ondrej/php5) was created as an exact copy of Debian php5 source package. There was a problem that Debian's libedit didn't include the required patch for interactive mode (at least I thought so, because the bug on libedit wasn't closed). I have just found that this issue has been already solved in libedit (2.11-20080614-4), but the bug wasn't properly closed.

Anyway the good news is that since this bug in libedit has been already solved in Debian, I will be rebuilding php5 with libedit and it will be included from php5 >= 5.4.12-2(~dist+1).

[Edit]: Also there's now php5-readline module, thanks to Andreas Pour, who poked me that it can be built and packaged now.

Solution 2:

I've just solved the problem here, a few minutes ago installing the readline module for php5:

$ apt-get install php5-readline
$ php -a
php>

Now it works fine. Don't know about windows, sorry.