================================================================================ cPanel DEPLOYMENT GUIDE - Phillipnes MLM System ================================================================================ This guide will help you deploy the application to cPanel and get it running. FILE: phillipnes-cpanel-deployment.zip SIZE: ~28MB READY: Yes - index.php and .htaccess are in the root directory ================================================================================ STEP 1: UPLOAD TO cPanel ================================================================================ 1. Log into your cPanel account 2. Navigate to "File Manager" 3. Go to your domain's public_html directory (or subdomain directory) 4. Upload the file: phillipnes-cpanel-deployment.zip 5. Right-click on the zip file and select "Extract" 6. This will create a "phillipnes" folder ================================================================================ STEP 2: MOVE FILES TO ROOT (if needed) ================================================================================ If you want the application to run from the root of your domain: Option A: Move contents to public_html root -------------------------------------------- 1. In File Manager, go into the "phillipnes" folder 2. Select ALL files and folders (Ctrl+A or Cmd+A) 3. Click "Move" and move them to public_html 4. Delete the empty "phillipnes" folder Option B: Keep in subdirectory ------------------------------- If you want it in a subdirectory (e.g., public_html/phillipnes), keep it as is. The index.php and .htaccess are already in the root of the phillipnes folder. ================================================================================ STEP 3: SET FILE PERMISSIONS ================================================================================ Run these commands in cPanel Terminal (or via SSH): cd ~/public_html # or cd ~/public_html/phillipnes if in subdirectory # Set proper permissions for directories find . -type d -exec chmod 755 {} \; # Set proper permissions for files find . -type f -exec chmod 644 {} \; # Make storage and cache directories writable chmod -R 775 storage bootstrap/cache chmod -R 775 public/storage 2>/dev/null || true ================================================================================ STEP 4: CREATE .env FILE ================================================================================ 1. In File Manager, look for a file named ".env.example" (if it exists) OR create a new file named ".env" 2. Create/edit .env file with these essential settings: APP_NAME="Phillipnes MLM" APP_ENV=production APP_KEY= APP_DEBUG=false APP_TIMEZONE=UTC APP_URL=http://yourdomain.com # Database Configuration DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_database_user DB_PASSWORD=your_database_password # Session & Cache SESSION_DRIVER=file CACHE_DRIVER=file QUEUE_CONNECTION=sync # Mail Configuration (update with your SMTP settings) MAIL_MAILER=smtp MAIL_HOST=mail.yourdomain.com MAIL_PORT=587 MAIL_USERNAME=your_email@yourdomain.com MAIL_PASSWORD=your_email_password MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS="noreply@yourdomain.com" MAIL_FROM_NAME="${APP_NAME}" ================================================================================ STEP 5: RUN COMPOSER INSTALL (if vendor folder missing) ================================================================================ If the vendor folder is not included or incomplete, run: cd ~/public_html # or cd ~/public_html/phillipnes # Install Composer dependencies php composer.phar install --no-dev --optimize-autoloader # OR if Composer is installed globally: composer install --no-dev --optimize-autoloader ================================================================================ STEP 6: GENERATE APPLICATION KEY ================================================================================ Run this command in cPanel Terminal: cd ~/public_html # or cd ~/public_html/phillipnes php artisan key:generate This will automatically update your .env file with APP_KEY. ================================================================================ STEP 7: RUN DATABASE MIGRATIONS ================================================================================ cd ~/public_html # or cd ~/public_html/phillipnes php artisan migrate --force This will create all necessary database tables. ================================================================================ STEP 8: CREATE STORAGE SYMLINK (if needed) ================================================================================ cd ~/public_html # or cd ~/public_html/phillipnes php artisan storage:link This creates a symbolic link from public/storage to storage/app/public for file uploads and public assets. ================================================================================ STEP 9: CLEAR AND CACHE CONFIGURATION ================================================================================ Run these commands to optimize the application: cd ~/public_html # or cd ~/public_html/phillipnes # Clear all caches php artisan config:clear php artisan cache:clear php artisan route:clear php artisan view:clear # Cache for production (optional but recommended) php artisan config:cache php artisan route:cache php artisan view:cache ================================================================================ STEP 10: SET UP CRON JOBS (if needed) ================================================================================ If your application uses scheduled tasks, set up a cron job in cPanel: 1. Go to cPanel → Cron Jobs 2. Add a new cron job: Frequency: * * * * * (every minute) Command: cd ~/public_html && php artisan schedule:run >> /dev/null 2>&1 OR if in subdirectory: Command: cd ~/public_html/phillipnes && php artisan schedule:run >> /dev/null 2>&1 ================================================================================ STEP 11: VERIFY .htaccess IS WORKING ================================================================================ Make sure mod_rewrite is enabled on your server. The .htaccess file should handle URL rewriting. If you get 404 errors: 1. Check that .htaccess file exists in the root 2. Verify mod_rewrite is enabled (contact your host if needed) 3. Check file permissions (should be 644) ================================================================================ STEP 12: TEST THE APPLICATION ================================================================================ 1. Visit your domain in a browser 2. You should see the application homepage 3. Try accessing admin and user login pages 4. Check for any error messages Common URLs: - Homepage: http://yourdomain.com - Admin Login: http://yourdomain.com/admin/login - User Login: http://yourdomain.com/user/login ================================================================================ TROUBLESHOOTING ================================================================================ Issue: 500 Internal Server Error Solution: - Check .env file exists and has correct values - Verify file permissions (755 for dirs, 644 for files) - Check storage and bootstrap/cache are writable (775) - Review error logs in storage/logs/laravel.log Issue: Database Connection Error Solution: - Verify database credentials in .env - Ensure database exists in cPanel - Check database user has proper permissions Issue: 404 Not Found on all pages Solution: - Verify .htaccess file exists in root - Check mod_rewrite is enabled - Ensure index.php is in root directory Issue: Permission Denied Solution: - Run: chmod -R 775 storage bootstrap/cache - Run: chmod -R 755 . (for directories) - Run: chmod -R 644 . (for files, but be careful) Issue: Composer not found Solution: - Download Composer: curl -sS https://getcomposer.org/installer | php - Or use: php composer.phar instead of composer ================================================================================ QUICK COMMAND REFERENCE ================================================================================ # Navigate to project directory cd ~/public_html # or cd ~/public_html/phillipnes # Set permissions find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; chmod -R 775 storage bootstrap/cache # Generate app key php artisan key:generate # Run migrations php artisan migrate --force # Create storage link php artisan storage:link # Clear caches php artisan config:clear php artisan cache:clear php artisan route:clear php artisan view:clear # Cache for production php artisan config:cache php artisan route:cache php artisan view:cache # Install dependencies (if needed) composer install --no-dev --optimize-autoloader ================================================================================ IMPORTANT NOTES ================================================================================ 1. The zip file excludes: - All .sh (shell script) files - All .md (markdown) documentation files - node_modules folder - .git folder - .env files (you need to create this) 2. index.php and .htaccess are already in the root of the extracted folder 3. Make sure PHP version is 8.2 or higher (check in cPanel → Select PHP Version) 4. Required PHP extensions: - pdo_mysql - mbstring - openssl - tokenizer - xml - ctype - json - fileinfo 5. If you need to run npm build for assets: npm install npm run build ================================================================================ SUPPORT ================================================================================ If you encounter issues: 1. Check storage/logs/laravel.log for detailed error messages 2. Verify all file permissions are correct 3. Ensure .env file has correct database credentials 4. Make sure PHP version meets requirements (8.2+) ================================================================================ END OF GUIDE ================================================================================