It's happened to all of us who use Drupal. We've installed a new theme or module and our beautiful homepage now looks like this:
Here are ways you can try to solve this problem and get your site back online.
These solutions are a good place to start but none of them will work for everyone. The right solution for your site will depend on which version of Drupal you're using, what modules and themes you have installed and which part of the site is broken.
Solution 1: Disable via the admin
You can try to visit the admin area directly by using URLs. For example, you could try to add /admin/ to your site's URL.
If this works, you can disable the theme or module directly from the admin area. However, this won't work if you aren't logged into the site,
Solution 2: Disable the files
You can disable themes and modules via FTP. This process works best with modules. With themes, it works only with Drupal 6. With D6, by breaking the Danland folder, Drupal should ignore the theme and revert back to Bartik. This will allow you to login again.
In this example, the Danland theme has thrown an error and I need to disable it. Here's the process:
- Login to the Drupal site via FTP.
- Browse to the /site/all/themes/ folder. This is the normal Drupal folder for installed themes, but you can also get a hint on where your problem is by looking at the error message on your site:
- Rename the themes folder. In this case, you can rename the /danland/ folder to /danland-error/
Solution 3: Re-upload the files
If Solution 2 doesn't work for you, what you can do next is this:
- Leave the broken copy of your theme or module in the re-named folder.
- Go to Drupal.org and download a fresh copy of the theme or module that is broken.
- Upload the fresh copy of the theme or module to replace the one that you just disabled.
Note: this will only work for themes and modules that are available on Drupal.org, not for custom ones.
Solution 4: Disable via settings.php
This only work for themes:
- Go to the settings.php file for your site. This is often located in your /sites/default/ folder.
- Open the file and look for the line which says: # $conf['theme_default'] = 'garland';
- Remove the # from this line.
- Save the file.
That should make Garland into your site's default theme. You'll be able to login to your site again and disable the broken theme.
Solution 5: Disable via the database
- Login to your Drupal database. In this example, I got access to the database by using PHPMyAdmin from the hosting company.
- Look for the system table in the database.
- Search through the system table to find the theme or module:
- You can disable the theme or module from here, by changing the status field from a 1 to a 0.
Solutions 6 and More
- Drupal.org has a useful page with more ideas on fixing broken themes: http://drupal.org/node/200774
- If your error message isn't showing a path to the /sites/, you may not have a problem with a theme or module but with another part of your site.
- If your site simply shows you a blank page, you may need to either try and roll back the latest changes to your site, or
- Please tell me you didn't forget the golden rule of running a site: BACKUP! BACKUP! BACKUP! BACKUP! BACKUP! Check to see if a backup of your site is available.