PHP Shell

PHP Shell is a shell wrapped in a PHP script. It’s a tool you can use to execute arbitrary shell-commands or browse the filesystem on your remote webserver. This replaces, to a degree, a normal telnet connection, and to a lesser degree a SSH connection.

You use it for administration and maintenance of your website, which is often much easier to do if you can work directly on the server. For example, you could use PHP Shell to unpack and move big files around. All the normal command line programs like ps, free, du, df, etc… can be used.

Getting Help

Please use the SourceForge facilities to obtain help on PHP Shell. You can submit bug reports, join the mailing lists.

Inherent Limitations

There are some limitations on what kind of programs you can run. It won’t do no good if you start a graphical program like Firefox or even a console based one like vi. All programs have to be strictly command line programs, and they will have no chance of getting user input after they have been launched.

They probably also have to terminate within 30 seconds, as this is the default time-limit imposed unto all PHP scripts, to prevent them from running in an infinite loop. Your ISP may have set this time-limit to something else.

But you can rely on all the normal shell-functionality, like pipes, output and input redirection, etc… (There is no <tab>-completion, though :-)

Safe Mode

Safe Mode is the nemisis of PHP Shell. If PHP is running in Safe Mode then PHP Shell will normally not work — sorry. Please read the detailed explaination in the SECURITY file included in the PHP Shell distribution.

Installation

PHP Shell is easy to install — download it and unpack it and configure the password. This is done in config.php. Please read the included INSTALL file for detailed information.

How to Use PHP Shell

When you point your browser at PHP Shell you will be asked to authenticate yourself. By default no username/password will work, so please go read INSTALL for information about adding a user.

You’re back? Good. Enter your username and password and press “Login”.

You will then be presented with a rather simple page containing nothing much except a big window with the cursor blinking at the bottom, signaling that it’s ready to obey your commands.

Write a command and press RET — or alternatively, press the ‘Execute Command’ button if you really want. The command will be executed and the result will be shows in the terminal. You can now enter another command.

To be more precise: the terminal is updated with the command line you have just executed, the output of the command to standard out (stdout), and following that any error output sent to stderr.

The commands are executed relative to a current working directory, which is written at the top. You change this by the normal ‘cd’ command.

Download

The latest version of PHP Shell is 2.4 from February 16, 2012. Download it as

The tarball/zipfile contains these files:

PHP Shell is kindly hosted by SourceForge: SourceForge.net Logo