A Security Baseline for PHP Websites on Shared Hosting
Use platform-compatible controls for authentication, private storage, request validation and deployment on conventional shared hosting.
Shared hosting limits server control, but it does not remove the need for application security. Public data files, weak sessions and writable upstream code can expose more risk than the hosting model itself.
A better approach
Keep secrets and private databases outside the document root, validate every input, escape output, protect state changes with CSRF and same-origin checks, and make upgrades a reviewed deployment process.
A practical checklist
- Use strong password hashing and secure session cookies
- Deny public access to private storage and backups
- Restrict uploads by type, size, dimensions and generated name
- Set security headers and disable unused administration features
A common trap
Do not rely on a hidden URL or an .htaccess rule alone to protect secrets. Application paths and filesystem placement should both fail safely.
What to take forward
A clear baseline makes the remaining risk visible. It also keeps security work compatible with the host instead of depending on services that are unavailable in production.
If you are planning related work, start a conversation with Protocols and Pixels.