🎯 Complete cPanel Installation Guide

Step-by-step guide to install Mighty-School on cPanel hosting environment

📋 Prerequisites: Make sure you have your cPanel login credentials and domain access ready before starting this installation process.

🚀 Mighty-School Installation Process

Step 1: Uploading the Project Files to cPanel

1.1 Log into cPanel
  • Open your web browser and navigate to your cPanel login page
  • Usually, it is: http://yourdomain.com/cpanel or http://yourdomain.com:2083
  • Enter your username and password to log in

Step 2: Setting Up the Database

2.1 Create a Database in cPanel
  • Go back to the cPanel Dashboard and scroll to the Databases section
  • Click on MySQL Databases
  • Under Create a New Database, provide a name for your database, e.g., mighty_school_db
  • Click Create Database
2.2 Create a MySQL User
  • Under the MySQL Users section, create a new MySQL user by entering a username and password
  • Click Create User
  • After creating the user, add them to the newly created database:
  • Under Add User to Database, select the user and database you just created
  • Check All Privileges and click Make Changes

Step 3: Create a Sub-domain for PHP Backend API

3.1 Create a Domain in cPanel
  • Go back to the cPanel Dashboard and scroll to the Domain section
  • Create a subdomain for your API (e.g., api.yourdomain.com)
  • Point it to a suitable directory (e.g., public_html/api)

Step 4: Upload Backend PHP Files

4.1 Upload Files to cPanel
  • Go back to the cPanel Dashboard and scroll to the Files section
  • Click on File Manager
  • Navigate to your subdomain directory (e.g., public_html/api)
  • Upload your Laravel backend files and extract them in the cPanel domain folder

Step 5: Run the Installation Process

5.1 Start Installation
  • Open your browser and navigate to your subdomain (e.g., http://api.yourdomain.com)
  • The Laravel installation process will start automatically
  • Follow the on-screen instructions to complete the setup

Step 6: Set Up File Permissions

6.1 Set Correct Permissions for Laravel Files

Laravel requires specific folder permissions to function correctly. Set the following folder permissions via File Manager or SSH if you have access:

  • storage/ and bootstrap/cache/ should be writable by the web server (usually 755 or 775 permissions)
Terminal Commands
chmod -R 775 storage bootstrap/cache

Step 7: Set Up Cron Jobs (Optional)

7.1 Configure Cron Jobs for Laravel Scheduler

If the Laravel application requires scheduled tasks (like daily reports, emails, etc.), you'll need to set up a cron job.

  • In cPanel, go to Cron Jobs under the Advanced section
  • Add a new cron job to run Laravel's scheduler every minute
Cron Job Command
* * * * * php /home/username/public_html/api/artisan schedule:run >> /dev/null 2>&1
⚠️ Note: Replace /home/username/public_html/api with your actual Laravel installation path.

Step 8: Test the Installation

8.1 Final Testing
  • Open your browser and go to your API domain (e.g., http://api.yourdomain.com)
  • Ensure the application is up and running
  • Test the API endpoints to verify functionality

🔧 Troubleshooting

Issue 1: Laravel not loading properly

Solution: Ensure storage and bootstrap/cache directories are writable.

Fix Permissions
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache

Issue 2: Database connection errors

Solution: Double-check your .env file, and make sure the database credentials and hostname are correct.

Database Configuration
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mighty_school_db
DB_USERNAME=your_username
DB_PASSWORD=your_password

Issue 3: 500 Internal Server Error

Solution: Check the Laravel error logs and ensure all required PHP extensions are installed.

  • Check error logs in storage/logs/laravel.log
  • Verify PHP version compatibility (Laravel 8+ requires PHP 7.3+)
  • Ensure required PHP extensions are enabled

🎉 Congratulations!

Your Mighty-School Laravel project should now be installed successfully on your cPanel hosting environment.

Next Steps:

  • Configure your frontend applications to connect to the API
  • Set up SSL certificates for secure communication
  • Configure backup solutions for your database
  • Set up monitoring and logging for production use