A. Prepare the site for production
- Test everything locally (all links, forms, cart, admin, mobile view).
- Move configuration into one place (
config/db.phpor environment variables) so you only change it once. - Turn off error display (
display_errors = 0) and log errors to a file instead. - Remove test pages, sample data,
phpinfo()files and debug code. - Optimise: compress images, minify CSS and JavaScript (optional), use relative or correct absolute paths.
- Export the database from phpMyAdmin (Export, SQL format).
- Check case-sensitivity: Linux servers treat
Logo.pngandlogo.pngas different files (Windows does not).
B. Set up the server side (shared hosting with cPanel)
- Log in to cPanel.
- MySQL Databases: create a database, create a database user with a strong password, and add the user to the database with all privileges. (Hosts add prefixes such as
acct_shop.) - phpMyAdmin: select the new database and Import your
.sqlfile. - Edit
config/db.phpon the server with the new host (usuallylocalhost), database name, username and password. - Select the PHP version (Select PHP Version or MultiPHP Manager) and enable needed extensions (
pdo_mysql,curl,mbstring,gd).
C. Upload the files
| Method | How |
|---|---|
| cPanel File Manager | Upload a .zip to public_html, then Extract (easiest for beginners) |
| FTP / SFTP | Use FileZilla: host, username, password, port 21 (FTP) or 22 (SFTP, preferred); drag files to public_html |
| Git deployment | git push to a repository; the host pulls or an action deploys (professional workflow) |
| SSH and rsync | For VPS servers |
- The website's root folder is usually
public_html(orhtdocs,www,html). The fileindex.phporindex.htmlthere is the home page. - Keep files that must not be public (config,
vendor, private data) outsidepublic_htmlwhen possible, or block access with.htaccess. - Set permissions: folders
755, files644; upload folders writable by PHP only where necessary (never777).
D. Test the live site
Visit the site and test every feature: registration, login, cart, checkout with sandbox payment, email sending, file uploads, mobile layout. Check the host's error log if something fails (500 errors are usually a wrong database password, a missing PHP extension, a wrong path or a PHP version mismatch).
E. After launch
- Backups: automatic daily backups of files and database; test a restore.
- Monitoring: uptime monitoring (UptimeRobot), error logs.
- Updates: keep PHP and libraries updated; remove unused plugins.
- SEO basics: meaningful
<title>andmeta description, headings,alttext,sitemap.xml,robots.txt, fast loading, register with Google Search Console. - Performance: enable gzip or brotli, browser caching headers, image compression, CDN (e.g. Cloudflare).
- Legal pages: privacy policy, terms and conditions, return policy, cookie notice.