How can I find the cause of a 500 server error?

Okay, here’s what I did. If this happens, hopefully this will work favourably for you.

  1. If this is disabled by default, enable wp-debug by changing the value from false to true.
  2. Check that you have enabled WP_DEBUG_LOG and WP_LOG_DISPLAY.
  3. Try refreshing the page and see what happens.
  4. Either using WinSCP or the terminal, go to

    /var/log/apache2/error.log

  5. If you see that certain PHP files are missing, download a fresh copy from here.
  6. Follow the prompts in the error log to replace each file that is missing, making sure to change ownership and permissions to www-data 0640 or 0644.
  7. If, after you have replaced everything, you find that WordPress is giving you a permission denied message, type the following:

    # find -type f -exec chmod 640 /var/www/html/my_site/html/blog {} \;

    # find -type d -exec chmod 750 /var/www/html/my_site/html/blog {} \;

  8. Continue repeating this process until your blog shows up.
  9. If WordPress tells you that a plugin is missing, you can either download a new copy or delete it and install it via the dashboard.