惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
C
Check Point Blog
月光博客
月光博客
Y
Y Combinator Blog
I
InfoQ
B
Blog RSS Feed
P
Proofpoint News Feed
腾讯CDC
博客园 - Franky
MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
罗磊的独立博客
B
Blog
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
Recent Announcements
Recent Announcements
美团技术团队
大猫的无限游戏
大猫的无限游戏

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Deploy a Website to cPanel Shared Hosting
Rafli Zocky · 2026-05-10 · via DEV Community
Cover image for Deploy a Website to cPanel Shared Hosting

Rafli Zocky

Even if you're using another framework or shared hosting provider, the process will be quite similar.

Steps

1. Export your local database (via phpMyAdmin or mysqldump)

2. Create two ZIP archives:

  • laravel.zip → all project files except the public folder
  • public.zip → contents of the public folder only

3. Create Database on cPanel

  • Login to cPanel → Manage My Databases
  • Create a new database, user, and assign user privileges

4. Import Database

  • Open phpMyAdmin in cPanel
  • Select the created database
  • Import the exported SQL file

5. Set PHP Version

  • In cPanel, open Select PHP Version
  • Choose PHP 8.2 (or required version)

6. Upload Files

  • Open File Manager in cPanel
  • Upload and extract:
    • public.zip → into /public_html/
    • laravel.zip → outside /public_html/ (e.g., /home/username/laravel/)

7. Configure index.php

Update paths in /public_html/index.php:

require __DIR__ . '/../laravel/vendor/autoload.php';
require_once __DIR__ . '/../laravel/bootstrap/app.php';

Enter fullscreen mode Exit fullscreen mode

8. Configure .env

Edit .env in the Laravel folder:

APP_URL=https://yourdomain.com

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=your_cpanel_db_name
DB_USERNAME=your_cpanel_db_user
DB_PASSWORD=your_cpanel_db_password

Enter fullscreen mode Exit fullscreen mode

9. Handle Storage

Without SSH, create a manual storage link by copying /laravel/storage/app/public/public_html/storage, or run php artisan storage:link locally before zipping.

Alternatively, create symlink.php at public_html:

<?php
$target = $_SERVER['DOCUMENT_ROOT']."/../laravel/storage";
$link = $_SERVER['DOCUMENT_ROOT']."/storage";
if(symlink($target, $link)){
    echo "OK.";
} else {
    echo "Failed.";
}
?>

Enter fullscreen mode Exit fullscreen mode

FAQ

Do I need to re-upload everything after changes?
Not always. You can upload only modified files, but many devs re-upload the whole project to avoid missing updates.

Other ways to upload besides cPanel File Manager?

  • FTP/SFTP → FileZilla, Cyberduck — easier for incremental updates
  • Git → Some shared hostings support Git via cPanel Git™ Version Control

Need help building your app?
I'm available for freelance web & Android development — raflizocky.netlify.app

☕ Support my writing: paypal.me/raflizocky · saweria.co/raflizocky