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.
Please use the SourceForge facilities to obtain help on PHP Shell. You can submit bug reports, join the mailing lists.
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 :-)
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.
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.
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".
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:
phpshell.php
: This is the script you run when you
use PHP Shell.
config.php
: Configuration file in the INI
format.
pwhash.php
: Password hashing script. This is used to
generate secure hashed passwords which you should use to prevent
others from getting to know your password by reading the
config.php file.
ChangeLog
: This file describe the changes we have made
to PHP Shell. By reading it you 'll always know when I've added a
new feature or made a bugfix, and the nature of the
feature/bugfix.
README
: Approximately this page.
AUTHORS
: Who contributed to PHP Shell?
INSTALL
: Tells you how to install PHP Shell. Amoung
other things, it explains how to change the password protection
so that you can use PHP Shell.
Remember that it's very important to have PHP Shell password protected, or else everybody will be able so snoop into your files and perhaps also be able to delete them! Please take the time to protect your installation of PHP Shell.
SECURITY
: A separate guide about security with PHP
in general and PHP Shell in particular. Be sure to read this
too, especially if you are getting strange errors back from PHP
Shell.
COPYING
: Standard GNU GPL.
.htaccess
: Ensures, that phpshell.php will be used as index page.