← All writing

Cute PHP shell

I had a WordPress-backed website on shared hosting. I had no root access—only a limited user with access to the MySQL database—and needed to clean junk files from an uploads directory owned by the web-server user.

My temporary solution was a small PHP utility that could delete a file or directory passed through a request. While looking for a more complete file-management interface, I found the open-source b374k project.

It could be placed in the web server's document root and configured from a browser to produce a single-file PHP administration utility with several modules.

Commands requiring superuser access still could not be used because there was no real terminal session. Running the web server as root would be a dangerous alternative and was not appropriate.

Historical note: browser-based server shells create serious security risk. Do not install one on a public server; use your hosting provider's supported file manager, SSH/SFTP access, backups, and least-privilege permissions instead.