Live-Verified #1: The Self-Deleting PHP Deploy Pattern
Discover a single-file PHP worker pattern for a 1,000-page site on shared cPanel hosting with no SSH access and no deployment pipeline.

Stock photo for illustration only, not from the actual event
- Built for small PHP sites on shared cPanel hosting without shell access
- Uses a single PHP file uploaded via web and triggered with a secret token
- Includes an 18-rule pre-flight checklist before executing any changes
- Automatically deletes itself immediately after completion for security
Pasting code changes directly into a production file through a browser file manager is a frequent cause of site downtime. Running The DJ Calendar—which consists of about 1,000 pages of PHP and MySQL on shared cPanel hosting without shell access, SSH, or a deploy pipeline—demands a reliable approach to survive live updates.
To overcome these infrastructure limitations, a specialized worker pattern was developed over months of live deployments and open-sourced as guarded-deploy-workers. This method aims to make manual production updates survivable without bringing down a revenue-generating website.
A worker is a single PHP file uploaded to the web root and triggered once using a secret token. The skeleton script is around 100 lines long, backed by a comprehensive 18-rule pre-flight checklist available in the repository.

Stock photo for illustration only, not from the actual event
This self-contained deployment approach highlights the reality for many developers managing production environments on constrained shared hosting where advanced CI/CD pipelines are unavailable. By combining strict pre-flight validations with a self-deleting mechanism, it mitigates common security risks like leaving installation or migration scripts exposed on the web server.
For those with a robust deployment pipeline, traditional tools should certainly be utilized. However, this pattern is tailored for the reality many developers live in: a cPanel box, FTP credentials, a live site, and no infrastructure team to rescue you. The repository is MIT-licensed on GitHub at github.com/bryanhamiltondev/guarded-deploy-workers.
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment