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 :-)

Disabled functions

Some functions may be disabled for security reasons in php.ini (for example functions which execute system commands). If that is the case, PHP Shell will not work (it uses for example proc_open()).
In older versions of PHP Safe Mode was used for that.

Installation

PHP Shell is easy to install - download it, unpack it and configure a username/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 are back? Good. Enter your username and password and click on "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 RETURN - 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 or use the links or select a subdirectory and click on "change to subdirectory".

Download

The latest version of PHP Shell is 2.6 from July 26, 2020. Download it as

You can use 7-zip to extract tar.gz-files on Windows. The tarball contains these files:

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