让PHP拥有Python一样的交互式shell

这是一个由facebook开发 的项目。
应该说FaceBook在PHP上贡献了不少东西了。
官方主页http://www.phpsh.org/

官方Git安装简介:https://github.com/facebook/phpsh

sudo easy_install sqlite3 readline
wget --no-check-certificate http://github.com/facebook/phpsh/tarball/master
tar zxvf facebook-phpsh-*.tar.gz
cd cd facebook-phpsh-*
sudo python setup.py install

运行phpsh,收工~~~~~~~~~~

phpsh
Starting php
type 'h' or 'help' to see instructions & features
php> =md5('ihipop')
"49425b23fac2fbc62dd45fc350139784"
php> $name='ihipop.info'

php> =$name
"ihipop.info"
php> echo $name
ihipop.info
php> =array(array('ihipop','info'),array('do'=>'it','love'=>'it'))
array(
0 => array(
0 => "ihipop",
1 => "info",
),
1 => array(
"do" => "it",
"love" => "it",
),
)
php>

注意 CentOS使用ActivePython的时候,pip安装readline库会报错 提示

/usr/bin/ld: cannot find -lncurses
collect2: ld 返回 1

error: command 'gcc' failed with exit status 1

安装下yum install ncurses-devel即可
如果提示

Fatal error: phpsh requires the following extensions: posix

安装下php-posix 或者php-process扩展即可

yum install php-posix

Author Info :
  • From:让PHP拥有Python一样的交互式shell
  • URL:https://blog.ihipop.com/2010/11/1826.html
  • Please Reserve This Link,Thanks!
  • 发表回复

    您的电子邮箱地址不会被公开。 必填项已用 * 标注