Drupal Troubleshooting Guide

1. Watchdog Database Logs

Drupal logs errors in the database using the Watchdog module, which is enabled by default. If you have access to the database via a tool like phpMyAdmin or command line access via MySQL client, you can query the Watchdog table directly.

To see the most recent log messages, you can run the following SQL query:


This query selects the last 50 entries in the Watchdog table. The message and variables columns will contain error information, though the variables column is serialized and may need to be unserialized to be human-readable.

2. PHP Error Logs

Since you’re using XAMPP, PHP’s error logs are another valuable resource for diagnosing an HTTP 500 error. By default, PHP errors might be logged to a file named php_error_log in the php directory within your XAMPP installation (/opt/lampp/logs/). This location can vary based on your PHP configuration (php.ini), where the error_log directive is set.

Open this log file with a text editor or use the tail command to view the last few entries:

tail -n 100 /opt/lampp/logs/php_error_log

This command displays the last 100 lines of the log file, where you might find errors related to your issue.

3. Apache Error Logs

Apache also logs errors, and these logs can provide details on what’s causing the 500 Internal Server Error. For a XAMPP installation, Apache’s error logs are typically located at /opt/lampp/logs/error_log.

You can view the most recent entries with:

tail -n 100 /opt/lampp/logs/error_log

Look for entries that correspond to the time the error occurred; they might give you specifics about what went wrong.

4. Enable Verbose PHP Error Reporting Temporarily

If the logs are not showing enough detail, you can temporarily increase the verbosity of PHP error reporting by modifying the php.ini file (/opt/lampp/etc/php.ini) and setting:

display_errors = On error_reporting = E_ALL log_errors = On

Remember to restart Apache after making these changes for them to take effect. This might provide more detailed errors directly in your browser or in the PHP error log.

5. Drupal’s settings.php

Lastly, ensure Drupal’s settings.php is configured to log errors by checking these settings:

$conf['error_level'] = 2; // Show all messages on your site

ini_set('display_errors', TRUE);

ini_set('display_startup_errors', TRUE);

This is particularly useful during development but should be used with caution on live sites.

By checking these logs and settings, you should be able to identify the cause of the HTTP ERROR 500 on your Drupal site.

6. Debugging Drupal:

  • Enable Drupal debugging: You can enable error reporting in Drupal by editing the sites/default/settings.php file and adding or updating these lines:
  • $config['system.logging']['error_level'] = 'verbose'; // Drupal 8 and later This might allow Drupal to display more detailed error messages on the screen or in its own logs.

7. How to enable verbose mode in Drupal

ou can temporary activate display of all errors by adding the next lines in your sites/default/settings.php file:

// Show all errors.
$config['system.logging']['error_level'] = 'verbose';
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

8. Manually Clear Cache

If Drush remains unresponsive and you need to clear your Drupal cache, you can do so manually through the database. This method requires access to your database via a tool like phpMyAdmin or command line.

  • Using MySQL Command Line:
    1. Log in to your MySQL database: mysql -u yourusername -p yourdatabase
    2. Run the following SQL command to clear the cache tables: DELETE FROM cache; Repeat this command for other cache tables (cache_render, cache_data, etc.), as needed.
  • Using phpMyAdmin:
    1. Open phpMyAdmin and select your Drupal database.
    2. Browse each cache table (cache, cache_render, cache_data, etc.).
    3. Use the “Empty” (or “Truncate”) option to clear the cache from each table.