Urgent Website Bug Fix
Urgent bugs — form won't submit, payment fails, page white screen — require different process than planned tasks. Diagnosis speed matters more than perfect code.
Diagnosis: where to look first
Frontend errors:
// Browser DevTools → Console
// Sentry: automatic error collection
import * as Sentry from '@sentry/nextjs';
// On error comes alert with full stacktrace
Backend errors:
# Laravel
tail -f storage/logs/laravel.log
# PHP-FPM
tail -f /var/log/php8.2-fpm.log
# Nginx
tail -f /var/log/nginx/error.log
# System
journalctl -u nginx -f
journalctl -u php8.2-fpm -f
Database:
# MySQL: slow queries, deadlocks
tail -f /var/log/mysql/error.log
mysql -e "SHOW PROCESSLIST;" # blocked queries
mysql -e "SHOW ENGINE INNODB STATUS\G" | grep -A 30 "LATEST DETECTED DEADLOCK"
Server resources:
top # CPU and memory
df -h # disk (full disk → 500 errors)
free -m # swap (swap → slowdowns)
netstat -an | grep ESTABLISHED | wc -l # connection count
Common urgent bugs and solutions
Form won't submit:
- Open DevTools → Network — check what POST returns
- Check CSRF token (Laravel:
php artisan key:generateif lost) - Check validation — validation errors can silently block
500 Internal Server Error:
# Always start with logs
grep "PHP Fatal" /var/log/nginx/error.log | tail -20
grep "exception" /var/www/mysite/storage/logs/laravel.log | tail -20
Site unavailable (504 Gateway Timeout):
# Check PHP-FPM processes
ps aux | grep php-fpm | wc -l
# Restart
sudo systemctl restart php8.2-fpm nginx
White screen (WSOD) in WordPress:
# Enable debug mode (temporarily!)
wp config set WP_DEBUG true
wp config set WP_DEBUG_LOG true
tail -f wp-content/debug.log
Hotfix without deploy
For truly urgent fixes on production without CI/CD:
# Only for really urgent cases
ssh user@server
cd /var/www/mysite
# Minimal change
nano src/components/ContactForm.tsx
# Rebuild
npm run build
pm2 restart myapp
After fix: post-mortem
Even for small incidents record:
- Discovery time
- Fix time
- Root cause
- How to prevent repeat
Quick bug fix (form, auth, page 500) — 1–4 hours.







