Skip to content
Hosting Operations6 min read

Website Down? 5 Fixes to Restore Uptime Fast

Fix a website down issue by checking disk space, PHP limits, and DNS. Follow these 5 steps to restore service and prevent future outages.

Written by Abdul AbrorTechnical Hosting Support Engineer
A blue laptop displaying the WordPress logo on a speckled blue surface
On this page

TL;DR — Key takeaways

  • Check disk usage first; a full partition is the most common cause of sudden website downtime.
  • Verify PHP memory limits and max execution time if the site loads partially or returns 500 errors.
  • Confirm DNS propagation and SSL certificate validity before assuming server-side failure.
  • Review error logs in /var/log/apache2/error.log or /var/log/nginx/error.log for specific stack traces.
  • Implement monitoring alerts for disk usage above 80% and CPU spikes to catch issues before users do.

A website down page is stressful. Users see an error, you see a ticket, and the clock is ticking. In support tickets I handled, the usual culprit was a full disk or a PHP memory limit hit. It’s rarely a mysterious failure.

This guide walks through the five most common causes of downtime and how to fix them. You’ll learn what to check first, how to verify the fix, and how to prevent the next outage. No fluff, just steps.

Check Disk Space First

Start here. A full disk is the number one cause of sudden downtime. When the partition holding your web root or logs fills up, the web server can’t write temporary files or log errors. It just stops.

Run df -h on your server. Look for the partition mounted at / or /var/www. If usage is above 90%, you’re in danger. Above 95%, the server is likely failing.

In one incident, a customer’s site went down at 3 AM. The disk was at 100%. Old log files from a debug session had filled the partition. Deleting those logs brought the site back in two minutes.

  • Run df -h to check disk usage.
  • Identify the partition with high usage.
  • Clear old logs, backups, or temporary files if above 90%.
  • Verify the web server can write to its log directory.

Verify PHP Configuration Limits

So what if the disk is fine but the site still shows a 500 error? Check PHP limits. Two settings cause most PHP-related downtime: memory_limit and max_execution_time.

If your site uses a CMS like WordPress or a framework like Laravel, it may need more memory than the default 128M. A large query or plugin can exceed this limit and crash the process.

Check your current limits with php -i | grep memory_limit. If it’s low, increase it in php.ini or your .htaccess file. For example, set memory_limit = 256M. Restart the web server after changes.

Be careful. Setting memory_limit too high can cause the server to run out of RAM if multiple PHP processes start. Monitor your server’s memory usage with free -m after making changes.

  • Check current PHP memory limit with php -i | grep memory_limit.
  • Increase memory_limit in php.ini or .htaccess if needed.
  • Check max_execution_time for long-running scripts.
  • Restart the web server to apply changes.
  • Monitor RAM usage with free -m to avoid exhaustion.

Confirm DNS and SSL Validity

Sometimes the server is fine, but users can’t reach it. DNS misconfiguration or an expired SSL certificate blocks access before the request even hits your web server.

Test DNS resolution with dig domain.com or nslookup domain.com. The returned IP should match your server’s public IP. If it doesn’t, check your DNS records at your registrar or DNS provider.

For SSL, run openssl s_client -connect domain.com:443 2>/dev/null | openssl x509 -noout -dates. If the certificate expired, renew it. Most hosting providers offer auto-renewal, but it can fail if the domain registrar contact info is outdated.

In support, I’ve seen sites go down because a DNS record was changed accidentally during a migration. The site was up, but users were hitting the wrong IP. Always verify DNS after any infrastructure change.

  • Test DNS with dig domain.com to verify the correct IP.
  • Check SSL certificate expiration with openssl s_client.
  • Renew expired certificates immediately.
  • Verify DNS records after migrations or IP changes.

Review Web Server Error Logs

If the above steps don’t fix it, the error log will tell you exactly what’s wrong. Don’t guess. Read the log.

For Apache, check /var/log/apache2/error.log. For Nginx, check /var/log/nginx/error.log. Look for the last few lines before the downtime started. You’ll see status codes like 500, 502, or 504, and often a stack trace or file path.

A 502 Bad Gateway usually means the PHP-FPM process crashed or is overloaded. A 504 Gateway Timeout means the backend took too long to respond. A 500 Internal Server Error is a generic catch-all for PHP or config issues.

Tail the log in real-time with tail -f /var/log/apache2/error.log while you reproduce the issue. This helps you see the exact error as it happens. Don’t forget to stop tailing before you close the terminal.

  • Check /var/log/apache2/error.log or /var/log/nginx/error.log.
  • Look for 500, 502, or 504 status codes.
  • Note the timestamp and file path in the error message.
  • Use tail -f to monitor logs in real-time during testing.

Implement Monitoring and Prevention

Fixing the issue is half the job. The other half is making sure it doesn’t happen again. Set up monitoring so you know about problems before your users do.

Install a monitoring tool like Uptime Kuma, Nagios, or use a hosted service. Configure alerts for disk usage above 80%, CPU spikes above 90%, and HTTP status codes other than 200.

For disk space, set up a cron job to clean old logs weekly. For example, find /var/log -name '*.log' -mtime +7 -delete. This prevents log files from filling the disk over time.

Test your monitoring setup. Trigger a test alert to make sure you receive it. If the alert doesn’t arrive, your monitoring is useless. In one case, a customer had monitoring set up, but the email alerts were going to a spam folder. They didn’t notice the downtime for six hours.

Finally, document your fixes. Keep a runbook with the steps you took. Next time, you’ll be faster. And if someone else is on support, they’ll know what to do.

  • Set up uptime monitoring with alerts for status codes and response time.
  • Configure disk usage alerts at 80% and 90%.
  • Automate log cleanup with cron jobs.
  • Test your alerting system to ensure notifications are received.
  • Document fixes in a runbook for future reference.

Quick troubleshooting checklist

  • Check disk usage with df -h and clear logs or old backups if above 90%.
  • Verify PHP memory_limit and max_execution_time in php.ini or .htaccess.
  • Test DNS resolution with dig or nslookup to ensure records point to the correct IP.
  • Check SSL certificate expiration with openssl s_client -connect domain:443.
  • Review web server error logs for 500, 502, or 504 status codes.
  • Restart the web service (systemctl restart apache2 or nginx) after config changes.
  • Set up uptime monitoring with alerts for response time and status code changes.

FAQ

Why is my website down but the server is online?

The web server process may have crashed, the domain DNS might not resolve, or the SSL certificate could be expired. Check the web server status with systemctl status apache2 and verify DNS with dig domain.com.

How do I fix a 500 Internal Server Error?

Enable display_errors in php.ini temporarily to see the specific error. Common causes include syntax errors in PHP files, permission issues on .htaccess, or exceeding memory limits. Check the error log for the exact line number.

What should I check first when a website is down?

Check disk space first with df -h. A full disk prevents the web server from writing logs or temporary files, causing immediate failure. If disk space is low, clear old logs or backups to restore service.