ENGINEERING JOURNAL

A deployment checklist for PHP sites on shared hosting

The repeatable checklist I run for every PHP deploy: backups, permissions, rewrite rules, cache-busting, verification and rollback.

THE ARTICLE 01 — 01

Deploying this portfolio to shared hosting gave me a repeatable checklist I now run for every PHP deploy. It is not exciting, but it is the difference between "uploaded" and "actually working". Each item below is something that broke or nearly broke during a real deploy.

1. Back up before you touch anything

Copy the live document root to a dated folder outside the web root, and keep a zip of it too. Verify the backup: compare file counts and spot-check that the zip extracts cleanly. A backup you have never tested is a rumor. If the deploy goes wrong, recovery is one copy command, not a support ticket.

2. Confirm the real document root

Do not assume it is public_html. Check the domain's actual document root in the hosting panel first — deploying to the wrong directory is an embarrassing way to spend an evening.

3. Fix permissions after every upload

Uploads and zip extractions reset file modes. On LiteSpeed shared hosting, the combination that works is: directories 0755, .htaccess and static files 0644, PHP files 0644. Wrong modes show up as unstyled pages or .htaccess errors, which look like code bugs but are not.

4. Sanity-check the server config

If the site uses rewrite rules, confirm clean URLs, redirects and the 404 page behave after the change — a single bad character in .htaccess can take down every page. Test a missing URL on purpose: you want your styled 404, not the server's default.

5. Bust the cache deliberately

Bump an asset version string when CSS or JS changes, so returning visitors get the new files instead of a stale cached copy. Then hard-refresh and check the site in a private window.

6. Verify what the visitor sees

Load the homepage, one nested page and one missing URL. Check HTTPS and the canonical host (www vs non-www). Confirm the contact form renders and any analytics snippet is present exactly once.

7. Tell search engines

If URLs changed, update sitemap.xml and re-submit it in Search Console, then request indexing for the important pages. A deploy that nobody can find is only half a deploy.

8. Keep a rollback path

Do not delete the backup until the new version has survived real traffic. "I can re-upload it" is not a rollback plan when you are tired at midnight.

Most deployment failures I have seen — including my own — were skipped checklist items, not hard problems. Related reading: deploying a no-framework PHP site on LiteSpeed shared hosting.

Muhammad Aqib ← ALL ARTICLES
KEEP EXPLORING

More ideas.
Better engineering.

Explore the journal ↗