Deployment Guide for Link Datacenter

This guide outlines the steps to deploy your PHP application to Link Datacenter hosting (business.linkdatacenter.net).

Deployment Flowchart

cPanel

Plesk

Start

Prepare Application

Hosting Panel Type

Log in to cPanel

Log in to Plesk

Create MySQL Database

Create Database User

Link User to DB

Import database.sql

Zip Project Files

Upload via File Manager

Extract Files to public_html

Update config/db.php

Test Website

End

1. Prepare Your Application

  1. Locate your project files in c:\xampp\htdocs\mattress.
  2. Select all files (folders admin, assets, config, etc., and files like index.php).
  3. Right-click > Send to > Compressed (zipped) folder. Name it website.zip.

2. Create MySQL Database

Link Datacenter typically uses cPanel or Plesk. Follow the steps for your specific panel.

Option A: cPanel (Linux Hosting)

  1. Log in to your hosting account (e.g., https://business.linkdatacenter.net/cpanel).
  2. Go to Databases > MySQL Database Wizard.
  3. Step 1: Create A Database.
    • Enter a name (e.g., mattress_shop).
    • Click Next Step.
    • Note down the full database name (usually prefix_mattress_shop).
  4. Step 2: Create Database Users.
    • Username: Enter a username (e.g., shopuser).
    • Password: Generate a strong password. Copy this password somewhere safe.
    • Click Create User.
  5. Step 3: Add User to Database.
    • Check ALL PRIVILEGES.
    • Click Make Changes.

Option B: Plesk (Windows Hosting)

  1. Log in to your Plesk panel.
  2. Go to Databases > Add Database.
  3. Fill in the details:
    • Database name: mattress_shop.
    • Database server: Default (usually localhost:3306).
    • Related site: Select your domain.
    • Database user name: shopuser.
    • Password: Generate and save a strong password.
  4. Click OK.

3. Import Database Schema

  1. Open phpMyAdmin from your control panel (cPanel or Plesk).
  2. Select your newly created database from the left sidebar.
  3. Click the Import tab at the top.
  4. Click Choose File and select c:\xampp\htdocs\mattress\database.sql from your computer.
  5. Click Go at the bottom.
  6. Success message will appear.

Database Schema Diagram:

places

contains

included in

users

int

id

PK

string

username

string

email

string

password

enum

role

datetime

created_at

products

int

id

PK

string

name

text

description

decimal

price

int

stock_quantity

string

image

datetime

created_at

orders

int

id

PK

int

user_id

FK

decimal

total_amount

enum

status

datetime

created_at

order_items

int

id

PK

int

order_id

FK

int

product_id

FK

int

quantity

decimal

price

4. Upload Files

  1. Go to File Manager in your control panel.
  2. Navigate to the public_html directory (or httpdocs in Plesk).
    • Delete any default "Coming Soon" or index.html files.
  3. Click Upload.
  4. Select your website.zip file.
  5. Once uploaded, right-click website.zip and choose Extract (or Decompress).
  6. Ensure all files are in the root of public_html (not inside a subfolder like website). If they are in a subfolder, select all, move them to public_html, and delete the empty folder.

5. Connect App to Database

You need to edit config/db.php on the server to use the new database details.

  1. In File Manager, find config/db.php.
  2. Right-click and choose Edit.
  3. Update the variables with the info from Step 2:

  1. Click Save Changes.

6. Final Verification

  1. Visit your domain (e.g., www.yourbusiness.com).
  2. Test the following:
    • Homepage loads correctly.
    • Click on a product.
    • Try to add an item to the cart.
    • Try to log in / register (if functionality exists).