═══════════════════════════════════════════════════════════════════════════════ KHELOPAKISTAN - CPANEL DEPLOYMENT CHECKLIST ═══════════════════════════════════════════════════════════════════════════════ 📋 PRE-DEPLOYMENT CHECKLIST ═══════════════════════════════════════════════════════════════════════════════ □ cPanel login credentials ready □ Domain name configured/purchased □ SSL certificate (Let's Encrypt is free) □ Email account created for noreply@yourdomain.com □ Payment gateway credentials (if using Stripe, PayPal, etc.) ═══════════════════════════════════════════════════════════════════════════════ STEP 1: CREATE DATABASE IN CPANEL ═══════════════════════════════════════════════════════════════════════════════ 1. Login to cPanel 2. Find "MySQL® Databases" (in Databases section) 3. Create Database: Database Name: khelopak_db (or your choice) Click "Create Database" 4. Create User: Username: khelopak_user Password: [Generate strong password] Click "Create User" 5. Add User to Database: User: khelopak_user Database: khelopak_db Privileges: ALL PRIVILEGES ✓ Click "Make Changes" 6. WRITE DOWN (you'll need these): ✎ Database Name: _______________________________ ✎ Database User: _______________________________ ✎ Database Password: ___________________________ ═══════════════════════════════════════════════════════════════════════════════ STEP 2: UPLOAD PROJECT FILES ═══════════════════════════════════════════════════════════════════════════════ METHOD 1: Using File Manager (Recommended for beginners) ───────────────────────────────────────────────────────── 1. In cPanel, go to "File Manager" 2. Navigate to "public_html/" folder 3. If deploying to subdomain/addon domain, create/navigate to that folder 4. Upload the entire project ZIP file 5. Right-click ZIP → "Extract" 6. Move extracted files to root level if needed 7. Delete the ZIP file METHOD 2: Using FTP (Recommended for faster upload) ──────────────────────────────────────────────────── 1. Download FileZilla or use your FTP client 2. Connect using: Host: yourdomain.com (or ftp.yourdomain.com) Username: [cPanel username] Password: [cPanel password] Port: 21 3. Navigate to public_html/ 4. Upload all project files ═══════════════════════════════════════════════════════════════════════════════ STEP 3: IMPORT DATABASE ═══════════════════════════════════════════════════════════════════════════════ 1. In cPanel, go to "phpMyAdmin" 2. Click on your database (khelopak_db) in left sidebar 3. Click "Import" tab at the top 4. Click "Choose File" button 5. Select "database_backup_for_cpanel.sql" from your computer 6. Scroll down and click "Go" button 7. Wait for "Import has been successfully finished" message ✓ Expected: ~118 tables imported ═══════════════════════════════════════════════════════════════════════════════ STEP 4: CONFIGURE .ENV FILE ═══════════════════════════════════════════════════════════════════════════════ 1. In File Manager, find ".env" file (in project root) 2. Right-click → "Edit" 3. Update these values: ┌─────────────────────────────────────────────────────────────┐ │ CRITICAL SETTINGS │ ├─────────────────────────────────────────────────────────────┤ │ APP_ENV=production │ │ APP_DEBUG=false ← IMPORTANT: Set to false in production! │ │ APP_URL="https://yourdomain.com" ← Your actual domain │ │ │ │ DB_DATABASE="cpanel_username_khelopak_db" │ │ DB_USERNAME="cpanel_username_khelopak_user" │ │ DB_PASSWORD="your_strong_database_password" │ │ │ │ FORCE_HTTPS="On" ← Enable after SSL is configured │ └─────────────────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────────────────┐ │ EMAIL SETTINGS (Optional but recommended) │ ├─────────────────────────────────────────────────────────────┤ │ MAIL_HOST="mail.yourdomain.com" │ │ MAIL_PORT="465" │ │ MAIL_USERNAME="noreply@yourdomain.com" │ │ MAIL_PASSWORD="email_password" │ │ MAIL_ENCRYPTION="ssl" │ │ MAIL_FROM_ADDRESS="noreply@yourdomain.com" │ │ MAIL_FROM_NAME="KheloPakistan" │ └─────────────────────────────────────────────────────────────┘ 4. Click "Save Changes" ═══════════════════════════════════════════════════════════════════════════════ STEP 5: SET FILE PERMISSIONS ═══════════════════════════════════════════════════════════════════════════════ 1. In File Manager, select these folders one by one: - storage/ - bootstrap/cache/ - public/uploads/ 2. For each folder: Right-click → "Change Permissions" Check: Read, Write, Execute for Owner, Group, World Or enter: 755 ✓ Check "Recurse into subdirectories" Click "Change Permissions" 3. Also set for .env file: Right-click .env → "Change Permissions" → 644 ═══════════════════════════════════════════════════════════════════════════════ STEP 6: CONFIGURE DOCUMENT ROOT (Choose ONE option) ═══════════════════════════════════════════════════════════════════════════════ OPTION A: Main Domain (yourdomain.com) ─────────────────────────────────────── 1. In cPanel File Manager, go to public_html/ 2. Copy ALL files from "public/" folder to "public_html/" 3. Edit "index.php" in public_html/: Find line: require __DIR__.'/../vendor/autoload.php'; Change to: require __DIR__.'/vendor/autoload.php'; Find line: $app = require_once __DIR__.'/../bootstrap/app.php'; Change to: $app = require_once __DIR__.'/bootstrap/app.php'; 4. Create .htaccess in public_html/ root with: Options -MultiViews -Indexes RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] OPTION B: Subdomain (shop.yourdomain.com) - RECOMMENDED ───────────────────────────────────────────────────────── 1. In cPanel, go to "Subdomains" 2. Create subdomain: shop 3. Set Document Root to: /public_html/khelopak/public 4. Click "Create" 5. No other changes needed! OPTION C: Addon Domain (Different Domain) ─────────────────────────────────────────── 1. In cPanel, go to "Addon Domains" 2. New Domain Name: yourshop.com 3. Document Root: /public_html/khelopak/public 4. Click "Add Domain" ═══════════════════════════════════════════════════════════════════════════════ STEP 7: INSTALL SSL CERTIFICATE ═══════════════════════════════════════════════════════════════════════════════ 1. In cPanel, go to "SSL/TLS Status" 2. Find your domain in the list 3. Click "Run AutoSSL" (Free Let's Encrypt SSL) 4. Wait for "Certificate installed successfully" message 5. Update .env file: FORCE_HTTPS="On" ═══════════════════════════════════════════════════════════════════════════════ STEP 8: OPTIMIZE LARAVEL (Via Terminal/SSH) ═══════════════════════════════════════════════════════════════════════════════ If you have SSH access: 1. SSH into your server 2. Navigate to project directory: cd public_html/khelopak (or your path) 3. Run optimization commands: php artisan config:cache php artisan route:cache php artisan view:cache php artisan optimize If no SSH access: Skip this step - not critical but recommended ═══════════════════════════════════════════════════════════════════════════════ STEP 9: TEST YOUR DEPLOYMENT ═══════════════════════════════════════════════════════════════════════════════ 1. Visit your website: https://yourdomain.com ✓ Homepage should load ✓ Images should display ✓ No errors visible 2. Test Admin Panel: URL: https://yourdomain.com/admin ✓ Login page loads ✓ Can login with admin credentials ✓ Dashboard displays correctly 3. Test Product Pages: ✓ Products display with images ✓ Can view product details ✓ Add to cart works 4. Test Checkout: ✓ Can proceed to checkout ✓ Can place test order ✓ Order appears in admin panel 5. Check Email: ✓ Order confirmation emails sent ✓ Test contact form ═══════════════════════════════════════════════════════════════════════════════ TROUBLESHOOTING COMMON ISSUES ═══════════════════════════════════════════════════════════════════════════════ ❌ 500 Internal Server Error ────────────────────────────── → Check storage/ permissions (should be 755) → Check .htaccess exists in public folder → Enable APP_DEBUG=true temporarily in .env → Check error logs in cPanel: Home → Errors ❌ Database Connection Error ───────────────────────────── → Verify DB_DATABASE, DB_USERNAME, DB_PASSWORD in .env → Check database user has ALL PRIVILEGES → Confirm DB_HOST is "localhost" (usually for cPanel) ❌ Images Not Loading ────────────────────── → Check public/uploads/ permissions (755) → Verify APP_URL in .env matches your domain → Run: php artisan storage:link → Clear browser cache ❌ White/Blank Page ──────────────────── → Set APP_DEBUG=true in .env (temporarily) → Check storage/logs/laravel.log → Verify PHP version is 8.2+ in cPanel ❌ CSS/JS Not Loading ────────────────────── → Check APP_URL in .env is correct → Run: php artisan optimize → Clear browser cache (Ctrl+F5) ❌ Redirect Loop ───────────────── → Set FORCE_HTTPS="Off" if no SSL → Check .htaccess rules → Disable CloudFlare SSL temporarily ═══════════════════════════════════════════════════════════════════════════════ POST-DEPLOYMENT TASKS ═══════════════════════════════════════════════════════════════════════════════ □ Set APP_DEBUG=false in production □ Configure payment gateways (Stripe, PayPal, etc.) □ Set up email SMTP settings □ Configure social login (Facebook, Google) □ Add products and categories □ Set up shipping methods □ Configure taxes if needed □ Add site logo and favicon □ Update About Us, Terms pages □ Set up backup schedule in cPanel □ Configure Google Analytics □ Submit sitemap to Google Search Console □ Test all payment methods □ Test email notifications ═══════════════════════════════════════════════════════════════════════════════ IMPORTANT SECURITY NOTES ═══════════════════════════════════════════════════════════════════════════════ ⚠ ALWAYS keep APP_DEBUG=false in production ⚠ Use strong database passwords ⚠ Enable FORCE_HTTPS after SSL installation ⚠ Keep Laravel and packages updated ⚠ Backup database regularly (use cPanel Backup) ⚠ Monitor error logs regularly ⚠ Protect .env file (already done in .htaccess) ═══════════════════════════════════════════════════════════════════════════════ ADMIN ACCESS ═══════════════════════════════════════════════════════════════════════════════ Admin URL: https://yourdomain.com/admin Check database `users` table for admin credentials, or create during first setup. ═══════════════════════════════════════════════════════════════════════════════ SUPPORT & RESOURCES ═══════════════════════════════════════════════════════════════════════════════ - Laravel Documentation: https://laravel.com/docs - cPanel Documentation: https://docs.cpanel.net - Project logs: storage/logs/laravel.log - cPanel error logs: Home → Metrics → Errors ═══════════════════════════════════════════════════════════════════════════════ Deployment Prepared by: Claude AI Assistant Date: December 30, 2025 Project: KheloPakistan E-Commerce Platform ═══════════════════════════════════════════════════════════════════════════════