12/15/2015 - 4:08 PM

PHP Interactive shell

PHP Interactive shell

However an alternative equivalent solution is facebook's phpsh. this is an interactive php shell and it has some nice features such as tabtab completion for function names and syntax highlighting for notices.

I installed it like so:

$ sudo apt-get install python # this is necessary to run phpsh
$ cd ~/

$ wget https://github.com/facebook/phpsh/zipball/master
$ unzip phpsh-master.zip

$ cd phpsh-master
$ sudo cp -r src /etc/phpsh # phpsh seems to complain unless it resides at /etc/phpsh
$ sudo ln -s /etc/phpsh/phpsh /usr/bin/phpsh # put phpsh on the $PATH

and voila its ready to use from any dir:

$ cd /etc/apt # some random dir

$ phpsh
Starting php
type 'h' or 'help' to see instructions & features
php> echo 'hi';