Arrow keys not working in shell

MY os: centos I solved the problem by :

sudo yum install rlwrap
alias tinker='rlwrap php artisan tinker'


The PHP REPL does not implement readline's line editing and history capabilities. I don't know if there's a PHP module that implements it, but you can do:

rlwrap php artisan tinker

You may have to install rlwrap for your OS.


This is due to PHP not being built with readline support. You can enable this when you compile and build PHP with the --with-readline argument.

http://php.net/manual/en/features.commandline.interactive.php