Hosting Requirements
- PHP 8.3 (8.2 minimum if host does not offer 8.3 yet)
- MySQL 8 / MariaDB, SSH or Terminal access (strongly recommended)
- Composer available via SSH or upload
vendorfrom local build - Ability to set document root to Laravel
publicfolder - Cron jobs (required for scheduler and queue processing)
Step 1: PHP Version and Extensions (cPanel)
In cPanel open Select PHP Version or MultiPHP INI Editor:
- Select PHP 8.3 for your domain.
- Enable:
bcmath,ctype,curl,fileinfo,gd,intl,mbstring,mysql,pcntl,pdo_mysql,posix,openssl,tokenizer,xml,zip,exif. - Set
memory_limit≥ 256M,max_execution_time≥ 300.
Verify from Terminal:
/usr/local/bin/php -mStep 2: Build and Upload Hostinger Package
On your local machine (with Composer and Node installed), create the hosting archive:
composer run package-hostingerUpload melodai-hostinger.zip via cPanel File Manager. Do not zip vendor or node_modules manually — large extracts often cause HTTP 500 on shared hosts.
- Extract zip into
public_html(or a folder above it). - Run
composer install --no-dev --optimize-autoloaderon the server after extract.
Step 3: Point Document Root to /public
- cPanel → Domains → edit your domain.
- Set document root to
/home/USERNAME/public_html/public(adjust path to match extract location). - If the host cannot change docroot, copy only
public/*intopublic_htmland updateindex.phppaths to the Laravel root one level up.
Step 4: Configure Production .env
APP_ENV=productionAPP_DEBUG=falseAPP_URL=https://melodai.siteQUEUE_CONNECTION=databaseFILESYSTEM_DISK=cloudflareSet database credentials from cPanel MySQL Databases:
DB_DATABASE=cpuser_melodaiDB_USERNAME=cpuser_dbuserDB_PASSWORD=strong_passwordIn Admin → Settings → General, set Site URL to your HTTPS domain. Cron HTTP URLs are generated from this value.
Step 5: Run Artisan Commands
From cPanel Terminal (use full PHP path):
/usr/local/bin/php /home/USERNAME/public_html/artisan key:generate --force/usr/local/bin/php /home/USERNAME/public_html/artisan migrate --force/usr/local/bin/php /home/USERNAME/public_html/artisan storage:link/usr/local/bin/php /home/USERNAME/public_html/artisan config:cache/usr/local/bin/php /home/USERNAME/public_html/artisan route:cache/usr/local/bin/php /home/USERNAME/public_html/artisan view:cacheComplete /install if this is a fresh server, or ensure installer was completed once.
Step 6: Cron Jobs and Queue Workers
Open Admin → Cron & Queue on your live site and copy the exact commands shown (they include your token and server paths).
HTTP cron (recommended for scheduler):
curl -s "https://yourdomain.com/cron/schedule?token=YOUR_TOKEN" > /dev/null 2>&1PHP queue workers (use full paths from admin page):
/usr/local/bin/php /home/USERNAME/public_html/artisan queue:work database --queue=default --sleep=3 --tries=3 --timeout=60 --stop-when-empty > /dev/null 2>&1Never use melodai.site/public_html/artisan as the command — that is a hostname fragment, not a file path. Use /usr/local/bin/php + absolute path to artisan.
Suggested schedules:
- Scheduler URL: every minute (
* * * * *) - Default queue: every minute
- Music generation queue: every 2 minutes (
*/2 * * * *) - Video processing queue: every 2 minutes
Step 7: SSL and SMTP
Enable AutoSSL in cPanel, then force HTTPS in APP_URL and Site URL.
Configure mail in Admin → Settings → Mail or .env:
MAIL_MAILER=smtpMAIL_HOST=mail.yourdomain.comMAIL_PORT=465MAIL_USERNAME=info@yourdomain.comMAIL_PASSWORD=mailbox_passwordTroubleshooting (Shared Hosting)
- Unauthorized on cron URL: copy fresh URLs from Admin → Cron & Queue; ensure identical token on all jobs.
- 500 after zip extract: run
composer install --no-devon server; checkstorage/logs/laravel.log. - Jobs stuck pending: verify queue cron commands use full PHP + artisan paths.
- FFmpeg missing: ask host to enable FFmpeg or use VPS for video features.