🌙
Happy Karwa Chauth! Wishing all couples a blessed Karwa Chauth. May your bond grow stronger every year. From Team Job...
💬 Share
Web Development Tutorials

How to Deploy a PHP Website to Hostinger (Files, Database, SSL, Checks)

Built your PHP site locally? Here's how to deploy a PHP website to Hostinger shared hosting, from uploading files to SSL and final checks.

In this article · 10 sections
  1. 1. Prepare locally
  2. 2. Upload files
  3. 3. Create the database
  4. 4. Update configuration
  5. 5. Domain and SSL
  6. 6. PHP settings
  7. 7. Email from the site
  8. 8. Go-live checks
  9. Moving an existing site?
  10. FAQs
  11. Why does my site show a 500 error after upload?
  12. Images work locally but not online. Why?

Your site works on localhost. Now it needs to go live. This guide shows how to deploy a PHP website to Hostinger shared hosting (the steps are similar on most cPanel/hPanel hosts).

1. Prepare locally

  • Remove test files, debug code and phpinfo() pages
  • Turn off display_errors for production
  • Export your local database (phpMyAdmin → Export → SQL)
  • Zip the project folder

2. Upload files

  1. hPanel → Websites → Manage → File Manager
  2. Open public_html (the web root for your domain)
  3. Upload the zip and Extract it
  4. Make sure index.php is directly inside public_html, not in a subfolder

You can also use FTP (FileZilla) or Git deployment if available.

3. Create the database

  1. hPanel → Databases → MySQL Databases
  2. Create a database, a user and a strong password (note the full names; they include a prefix like u123456789_)
  3. Open phpMyAdmin for that database and Import your SQL file

4. Update configuration

Edit your config/connection file with the live database name, user and password. The host is usually localhost. Keep this file out of public reach where possible and never commit real passwords to public Git repositories.

5. Domain and SSL

  • If the domain is registered elsewhere, point nameservers or A record to Hostinger. See DNS records explained
  • Enable the free SSL in hPanel and force HTTPS. See SSL guide
  • Add redirects for www/non-www and clean URLs in .htaccess. See .htaccess basics

6. PHP settings

hPanel → Advanced → PHP Configuration: choose a PHP 8.x version matching what you tested, and enable needed extensions (mysqli, gd, intl, etc.).

7. Email from the site

Shared hosts restrict PHP mail(). Use SMTP with PHPMailer. See PHP contact form with PHPMailer.

8. Go-live checks

  • [ ] Home and inner pages load over HTTPS with no mixed content
  • [ ] Forms submit and emails arrive
  • [ ] Admin login works
  • [ ] Images and CSS load (check paths are relative/correct case; Linux is case-sensitive)
  • [ ] 404 page works
  • [ ] Mobile view checked
  • [ ] Google Search Console and sitemap submitted
  • [ ] Backups enabled. See website backups

Moving an existing site?

See move website and domain to new hosting.

FAQs

Why does my site show a 500 error after upload?

Common causes: wrong PHP version, .htaccess rules not supported, or database credentials. Check error logs in hPanel. See debugging PHP errors.

Images work locally but not online. Why?

Linux servers are case-sensitive: Logo.png and logo.png are different files.

Was this article helpful?

Your answer helps us improve our guides

Share this article

Joboo Web

Web design, SEO & digital marketing team · Ludhiana, Punjab

Joboo Web has helped Indian businesses grow online since 2019 — building fast websites and running SEO, Google Ads and social campaigns for clients in 80+ cities. About us →

Keep reading

💬