“The website encountered an unexpected error. Please try again later.”
There are over 700 people who have reported the same problem on the Drupal.org forums.
If you have this error or similar errors và are thinking, “OMG! Now what?”, then hang tight.
We’re here lớn help with this tutorial. We’ll show you how to diagnose & solve errors that appear on your Drupal site.
Print Errors to lớn the Screen
If you see an error with no information or you see the white Screen of Death (WSOD), one of things you should vày is start looking for errors.
To make errors visible on your Drupal website, find the index.php file in the main directory of your site. Open index.php and showroom this code directly before the very first line of the file:
codecitation error_reporting(E_ALL); ini_set(‘display_errors’, TRUE); ini_set(‘display_startup_errors’, TRUE); /codecitation
In the example below, I have an error with the Weather module. I have deliberately loaded the Weather module lớn one of my chạy thử sites in an unconventional way & broken the code in an effort to trigger an error:
This error tells me that something is wrong on line 629 of weather.module. Of course, if this was a production site và errors were not enabled to lớn print khổng lồ screen, a WSOD would send me running khổng lồ my error logs to see the same message.
(As a side note, it is not common practice lớn upload the weather-7.x-1.5 directory & it had nothing to vì with triggering an issue.)
Let’s assume you got a WSOD và need lớn look at your error logs. I am not a hệ thống expert but I can tell you where my error logs are located. As you can see from the screenshot above, my error logs are at the same màn chơi as my html directory. The html directory is where your Drupal files and directories are stored.
The control panel I have on my vps allows me to kiểm tra a box and click edit, as shown in the screenshot above. If your vps doesn’t have this feature, download the error log file & view it locally.
As you can see, it’s telling me the line 629 in weather.module has an issue. It also says it can’t find a favicon.ico file. Hmmm. I’ll have khổng lồ fix that. Anyway, now that I know where to lớn look for the problem, I can open weather.module & see what might be wrong.
Some issues are triggered when a user lands on a specific page while others seem lớn affect all your pages. If for some reason, you can’t reach /#overlay=admin/modules or /admin/modules và disable the problem module, try the following.Launch PHPMyAdmin. I can access it by going to lớn my domain.com/myadmin. If that doesn’t work, ask your service provider for help.Select the database .Click on the browse icon for the System table.Locate the record with a path to lớn your module. In this example, the path is sites/all/modules/weather-7.x-1.5/weather/weather.module.Click the little pencil icon lớn edit the record.Locate the status & observe the value is 1.Change the status value to 0.Click Go.Return to your site and refresh.
You should be able to lớn access your site again. If you go lớn the modules admin page, you will see the module is disabled. If you go to the Uninstall tab, you will see that it is waiting to lớn be uninstalled. If you uninstall the module via the Drupal admin interface, the module directory is still on your server and still available khổng lồ enable again.
Now that you have your site back, your next step is lớn resolve the problem so that you can use the module.
Because the line number is a clue lớn where I will find the problem, I have down loaded the weather.module and opened it in Notepad++. You could use any code friendly application that shows line numbers. I scrolled down & found line 629. As you can see from the screenshot, there is a rogue