Requirements
Hosting Requirements
Your shared hosting must support:- PHP 8.4 or higher
- Database (MySQL, MariaDB, PostgreSQL, or SQLite)
- Ability to point domain to a subdirectory (for
/publicfolder) - FTP or File Manager access
Required PHP Extensions
Verify your hosting includes these PHP extensions:- Ctype, cURL, DOM, Fileinfo, Filter, Hash, Mbstring, OpenSSL, PCRE, PDO, Session, Tokenizer, XML, BCMath, Zip, Intl, GD, Exif
Local Machine Requirements
You’ll need these tools on your computer:- Git
- Composer (PHP dependency manager)
- Node.js & NPM (for building assets)
- FTP Client (FileZilla, Cyberduck, or similar)
Preparation on Local Machine
The
--no-dev flag is crucial - it prevents installing development dependencies that could expose security vulnerabilities.Configure Environment
Before uploading, configure your.env file with your hosting details.
Application Settings
Database Configuration
Finding Your Database Credentials
Finding Your Database Credentials
Database credentials are typically found in:
- cPanel: MySQL Databases section
- Plesk: Databases panel
- Custom panels: Check hosting documentation
- Email: Welcome email from hosting provider
DB_HOST: Oftenlocalhostor127.0.0.1DB_PORT: Usually3306for MySQL- Create database through hosting control panel before deployment
Mail Configuration
Shared Hosting SMTP Settings
Shared Hosting SMTP Settings
Upload Files to Hosting
Important: Upload everything, including:
vendor/folder (PHP dependencies)public/build/folder (compiled assets).envfile (your configuration)- Hidden files like
.htaccess
public_html or wwwUploading may take 15-30 minutes depending on your connection speed. The
vendor folder contains thousands of files.Faster Upload Tips
- Use an archive: Compress the project locally and extract on the server (if file manager supports it)
- Use SFTP: Often faster than regular FTP
- Parallel transfers: Configure your FTP client for multiple simultaneous transfers
- Resume capability: Use an FTP client that can resume interrupted transfers
Configure Web Server
Method 1: Using cPanel/Control Panel
Most hosting control panels allow you to set the document root:- cPanel: Go to “Domains” → “Domains” → Click “Manage” next to your domain
- Document Root: Change from
/public_htmlto/public_html/public - Save changes
Method 2: Using .htaccess (If public folder not configurable)
If you can’t change document root, create.htaccess in your project root:
.htaccess (Root Directory)
Verify .htaccess in Public
Ensure the.htaccess file exists in the public directory:
public/.htaccess
File Permissions
Set Permissions via FTP
Set the following permissions (chmod):- storage/ directory:
775(rwxrwxr-x) - bootstrap/cache/ directory:
775(rwxrwxr-x) - All subdirectories in storage:
775 - All files in storage:
664(rw-rw-r—)
Using cPanel File Manager
- Navigate to your Health Manager directory
- Right-click
storagefolder → “Change Permissions” - Set to
775and check “Recurse into subdirectories” - Repeat for
bootstrap/cache
First Access & Admin Setup
Health Manager features automatic installation on first access:Troubleshooting
500 Internal Server Error
500 Internal Server Error
Check these common issues:
- File permissions: Ensure
storageandbootstrap/cacheare writable (775) - Missing .env: Verify
.envfile was uploaded - PHP version: Confirm hosting uses PHP 8.4+
- Check error logs:
- cPanel: Error Log in Metrics section
- Or check
storage/logs/laravel.logvia FTP
Blank White Page
Blank White Page
Possible causes:Check the error, then set back to
- PHP errors hidden: Check error logs
- Missing assets: Verify
public/buildfolder uploaded - Wrong document root: Ensure domain points to
/public - Composer dependencies: Verify
vendorfolder uploaded completely
.env:false.Database Connection Failed
Database Connection Failed
Troubleshooting steps:Delete this file after testing.
- Verify credentials: Double-check
.envdatabase settings - Database exists: Ensure database created in cPanel
- User permissions: Database user must have all privileges
- Remote access: Some hosts use remote database servers
- Host value: Try both
localhostand127.0.0.1
test-db.php in public folder:Assets Not Loading (CSS/JS Missing)
Assets Not Loading (CSS/JS Missing)
Solutions:
-
Verify build folder: Check
public/builddirectory exists and contains files -
Rebuild locally:
Then re-upload
public/buildfolder -
Check .htaccess: Ensure
public/.htaccessuploaded correctly - Clear browser cache: Hard refresh (Ctrl+F5)
-
Verify APP_URL: Must match your domain in
.env
Upload Errors / Timeout
Upload Errors / Timeout
File upload size limits:
-
Increase PHP limits via
.htaccessin public folder: -
Or via php.ini (if your host allows):
- Contact hosting support if limits can’t be changed
Email Not Sending
Email Not Sending
Common issues:
- Wrong SMTP settings: Verify with hosting provider
- Port blocked: Try alternative ports (465, 2525)
- Authentication required: Ensure username/password correct
- SPF/DKIM records: May need DNS configuration
- Test SMTP: Use online SMTP testers
Updates
To update Health Manager on shared hosting:cd health-manager
git pull origin main
composer install --no-dev --optimize-autoloader
npm install && npm run build
.env file (keep your configuration)vendor and public/build uploaded completelyPerformance Tips
Enable OPcache
If your hosting supportsphp.ini customization:
php.ini
Enable Compression
Add topublic/.htaccess:
Browser Caching
Add topublic/.htaccess:
Security Best Practices
- Use HTTPS: Install SSL certificate (often free via Let’s Encrypt in cPanel)
- Strong passwords: Use complex database and admin passwords
- Regular backups: Automate database and file backups
- Update regularly: Keep Health Manager updated
- Monitor logs: Check
storage/logs/laravel.logperiodically - Disable directory listing: Ensure
.htaccessprevents directory browsing
Next Steps
- Configure SSL certificate for HTTPS
- Set up automated database backups
- Configure email notifications
- Customize application settings
- Create additional user accounts
- Review and adjust file upload limits
