phpsh

发布时间:2021-07-16 17:07:50 阅读:1265次

 转:http://blog.s135.com/post/392/
PHPSH 是 
Facebook 团队开发的一款交互式 PHP Shell,可以方便地进行PHP命令行测试。

  网址:
http://www.phpsh.org/

  安装方法:

cd /opt/
wget 
http://www.phpsh.org/phpsh-latest.tgz
tar zxvf phpsh-latest.tgz
cd phpsh/
sed -i "s#php -q#/usr/local/webserver/php/bin/php -q#g" phpsh
chmod +x phpsh
ln -s /opt/phpsh/phpsh /bin/phpsh


  注意:上述安装方法中的“/usr/local/webserver/php/bin/php”为您的PHP可执行文件路径。


  使用示例:

[root@localhost ~]# phpsh
I can't find a tags file for you.  To enable tab completion in phpsh,
go to the root directory of your php code and run 'ctags -R',
(or whatever the analagous command is with your version of ctags,)
then run phpsh from that directory or a subdirectory of that directory.

Commandline: /usr/local/webserver/php/bin/php -q /opt/phpsh/phpsh.php
phpsh (c)2006 by Charlie Cheever and Dan Corson and Facebook, Inc.
type 'h' or 'help' to see instructions & features

New Feature: You can use the -c option to turn off coloring
php> = 3 + 4
7
php> = md5("ZhangYan")
28f91f3a4b62ce57b7a533e742e8aae1
php> echo date("Y-m-d H:i:s") 
2009-01-13 15:28:19
php> $var = "blog.s135.com"
php> echo $var
blog.s135.com
php> $array = array(array(1,2,3), array("a" => "b", "c" => "d", "e" => "f"), 'g', 'h')
php> = $array
Array
(
    [0] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

    [1] => Array
        (
            [a] => b
            [c] => d
            [e] => f
        )

    [2] => g
    [3] => h
)

php> q

[root@localhost ~]# phpsh

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询

转载请注明:phpsh 出自老鄢博客 | 欢迎分享