Developers and agencies — grow with our partner program
Get started

Blog VPS & Developers

Deploy a Simple PHP Site on Shared Hosting

By HostPawa Team
Share

Not every PHP project needs Docker, Kubernetes, or a VPS. A school site, portfolio, small CRM, or brochure app can live happily on shared hosting if you deploy cleanly. This walkthrough shows a practical path on HostPawa PHP hosting / web hosting, including free SSL via our Free SSL guidance.

What you need before you start

  • A HostPawa hosting account and domain (or a subdomain for testing)
  • Your site files (PHP templates, assets, and any vendor/ folder if you use Composer)
  • Database credentials if the app stores data
  • SFTP client (FileZilla, WinSCP, Cyberduck) or the panel file manager

Step 1 — Create or confirm the hosting account

Order or open your web hosting plan and note:

  • Control panel login
  • SFTP/SSH host, username, and port (if SSH is enabled on your plan)
  • Default document root (often public_html for the primary domain)

If you are deploying an addon domain or subdomain, create it in the panel first so the correct folder exists.

Step 2 — Pick the PHP version

In the panel, set PHP to a supported modern version that matches your code. Simple sites often run fine on current PHP 8.x. Avoid ancient versions “for compatibility” unless a legacy library truly forces it—and plan to upgrade that library.

Step 3 — Upload files

  1. Connect with SFTP using the panel credentials.
  2. Navigate to the site’s document root.
  3. Upload your PHP files and assets.
  4. If the app uses a public/ front controller pattern, either upload so public/ contents land in the web root, or adjust the document root to public/ when the panel allows it.

Do not upload .env with debug secrets into a public folder. Keep configuration outside the web root when possible, or protect it with permissions and server rules.

Step 4 — Create the database

  1. Open MySQL databases in the panel.
  2. Create a database and a user with a strong password.
  3. Grant that user access only to that database.
  4. Import your .sql dump via phpMyAdmin or the CLI if available.
  5. Update the app config with host (often localhost), database name, user, and password.

Step 5 — Set permissions carefully

Directories that must accept uploads need write access; everything else should be as restrictive as the panel allows. Typical pattern:

  • Code files readable by the web server, not world-writable
  • Storage/upload folders writable
  • No 777 unless you are temporarily debugging—and revert immediately

Step 6 — Enable HTTPS

Issue a certificate for the domain (Let’s Encrypt-style automation on modern hosts). Then force HTTPS so forms and cookies stay secure. HostPawa’s Free SSL page explains the SSL story for customers. After SSL is active, update any hardcoded http:// links in templates or the database.

Step 7 — Point DNS

  1. At your domain DNS host, set A/AAAA (or nameservers) as instructed in the HostPawa welcome email/panel.
  2. Wait for propagation; use a staging subdomain first if the apex domain is already live elsewhere.
  3. Lower TTL ahead of cutover when you can.

Step 8 — Smoke-test like a user

  • Homepage loads over HTTPS
  • Forms submit and show success/error states
  • Login works if applicable
  • File upload works (and lands in the right folder)
  • 404 page is acceptable
  • Email notifications send (or fail loudly in logs so you can fix SMTP)

Check the panel error log after the first hour of traffic. Most deploy bugs show up immediately: missing extensions, wrong DB password, or incorrect paths.

Composer apps on shared hosting

If you use Composer:

  • Run composer install --no-dev locally or in CI
  • Upload the generated vendor/ directory
  • Ensure the autoloader path in your front controller is correct

Some plans allow SSH Composer on the server; if not, build elsewhere and upload artefacts.

Common mistakes

  • Uploading the entire project above public/ but leaving the web root pointing at the project root (exposes .env and source)
  • Leaving display_errors on in production
  • Forgetting to update config after importing a database from localhost
  • Assuming mail() will deliver reliably without SPF/DKIM alignment
  • Skipping backups before overwriting an existing site

When shared hosting is no longer enough

Move up when you need persistent queue workers, custom server packages, or more CPU/RAM isolation. Until then, shared PHP hosting remains the fastest way to ship a simple site. Pair it with solid web hosting features and free SSL, and you have a production-ready baseline.

Bottom line

Deploying a simple PHP site is a checklist, not a mystery: correct PHP version, clean upload into the right document root, database wired, HTTPS on, DNS pointed, smoke tests done. Follow those steps on HostPawa and you will spend your energy on the product—not on fighting the server.

Recent posts

All posts

Launch your website in minutes

Fast hosting, free SSL, and local payments — built for Nigerian businesses.