Developers whose newly deployed or local Laravel project displays a blank white screen with '500 Server Error'.
- ✓Access to terminal or cPanel File Manager
🚀 What You Will Learn & Build
- ▸Locating the exact error message inside storage/logs/laravel.log
- ▸Fixing storage and bootstrap/cache permissions (chmod 775)
- ▸Generating missing application encryption keys (APP_KEY)
- ▸Verifying required PHP extension availability
1. The Golden Rule: Read storage/logs/laravel.log
2. The #1 Cause on Hosting: Unwritable Storage Permissions
# On Ubuntu / VPS:
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache
# On shared cPanel:
# In File Manager, right-click storage/ and set permissions to 755 (or 775).
# Right-click bootstrap/cache/ and set permissions to 755 (or 775).3. The #2 Cause: Missing or Unset APP_KEY
✨ Expected Output & Verification
The site loads cleanly with HTTP 200, or (in local dev with APP_DEBUG=true) displays Laravel's informative Ignition error screen.
🧪 How to Test the Implementation
- 1Run `php artisan about` in terminal to verify environment, cache, and driver status
- 2Inspect web server error log at /var/log/nginx/error.log or cPanel Errors tool
⚠️ Common Errors & How to Fix Them
Root Cause: PHP extension missing from hosting server.
Fix: In cPanel 'Select PHP Version', check the boxes for mbstring, pdo_mysql, and bcmath.
🛡️ Security Considerations & Best Practices
- !Never leave APP_DEBUG=true in production; it reveals environment variables to visitors when a 500 error occurs.
❓ Frequently Asked Questions (FAQ)
Missing or disabled mod_rewrite in Apache. Ensure public_html contains the official Laravel .htaccess file.
📌 Summary of Key Takeaways
- ✓Always check storage/logs/laravel.log first.
- ✓Ensure storage and bootstrap/cache are writable.
- ✓Generate APP_KEY and clear config cache.
Official References & Further Reading
- 🔗Laravel Error Handling Docs— Official guide to exception handling and logging.
Written by Manoj Neupane
AuthorSoftware developer and programming instructor, Nepal
Building software systems and SaaS platforms with Laravel, Next.js, and Node.js. Passionate about helping students and developers in Nepal master practical, real-world development skills.