Phpsh: install and use the PHP shell developed by Facebook [reprint]

Source: Internet
Author: User
Tags echo date
[ Article Author: Zhang banquet this article version: V1.0 last modified: 2009.01.13 reprinted please indicate the original article link: http://blog.s135.com/post/392/]

Phpsh is an interactive PHP shell developed by the Facebook team to facilitate PHP command line testing.

URL: http://www.phpsh.org/

Installation Method:CD/opt/
Wget http://www.phpsh.org/phpsh-latest.tgz
Tar zxvf phpsh-latest.tgz

Copy the src directory and rename it phpsh.

Clear the paths obtained before RC. php In phpsh. php.

Chmod + x phpsh

Ln-S/XXX/phpsh/bin/phpsh

Example: [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. 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 ")
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.