Facebook’s “phpsh” - interactive shell for PHP
I love direction in which IRB for ruby works. My friend, Antono uses IRB very often when testing or debuging his RoR applications. So i feel, that i need something similar, but for PHP.
There are lot of different tryies to implement comfortable interactive shell in PHP, such as phpa or ~jk php shell. But i thinks, that Facebook developers with their phpsh found the best way of doing this & that’s why:
- full commands history, based on readline;
- tab completion for functions;
- simple output highlight;
- access to documentation for commands.
Screenshot

Unfortunately, it’s written mostly in python, so the install process is not trivial for most PHP devs. So, i’ve wrote a small manuals for you, Mac OS & Linux users =)
Install
Install under Mac OSX (10.5+)
- install python 2.6 from MacPorts, because python’s
select.polllib doesn’t work on MacOSX bundled python:sudo macports install python26sudo macports install python_selectsudo python_select python26
- install pysqlite for autocompletion:
wget http://pysqlite.googlecode.com/files/pysqlite-2.5.6.tar.gztar -xvf pysqlite-2.5.6.tar.gz && cd pysqlite-2.5.6python setup.py buildsudo python setup.py install
- install phpsh:
git clone git://github.com/facebook/phpsh.gitor download package herecd phpshpython setup.py buildsudo python setup.py installcd /usr/local/binln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/phpsh
Install under Linux
- install pysqlite for autocompletion:
wget http://pysqlite.googlecode.com/files/pysqlite-2.5.6.tar.gztar -xvf pysqlite-2.5.6.tar.gz && cd pysqlite-2.5.6python setup.py buildsudo python setup.py install
- install phpsh:
git clone git://github.com/facebook/phpsh.gitor download package herecd phpshpython setup.py buildsudo python setup.py install