My modules page is blank, says "page not found" or returns an error message

Last modified: October 23, 2009 - 20:36

If you attempt to load admin/build/modules and get a blank page, a message that says "The requested page could not be found" or a server error, this is most likely a memory issue.

When viewing this page, modules are (since Drupal 5.x) only loaded if they are enabled (previously, even disabled modules were loaded). Even so, a fair amount of ancillary processing takes place on this page and can cause PHP to run out of available memory. Note that all modules' .info files are loaded whether or not the modules are enabled.

There are two fixes:

  1. Increase PHP's memory limit, e.g. to set it to 16MB try one of these:
    • memory_limit = 16M to your system's main php.ini file (recommended, if you have access. In case you don't, you can try to upload your own php.ini file in the root folder of your Drupal installation, but bear in mind that this will only have an effect if PHP is running as CGI)
    • ini_set('memory_limit', '16M'); in your sites/default/settings.php file (this doesn't work on all servers)
    • php_value memory_limit 16M in your .htaccess file in the Drupal root (this only works if PHP is running as an Apache module)

    Depending on the amount of modules you have enabled and their 'impact' on the site you may need to increase the memory_limit even more, but don't exceed you server memory limit as it could cause your site more problems. Experiment with what memory value works for your needs. Some people find they need to set the memory to 24M or 32MB or higher (e.g. 96MB is recommended for a site with built-in image processing using ImageAPI GD).

  2. You can reduce the memory required by your site by disabling modules by directly editing the {system} table in the database and setting the status column to 0. It's best just to disable contributed modules, and preferably those that are not dependents of others. Take a database backup first, in case you mess things up.

Prior to Drupal 5.x a quick fix was to remove disabled modules' folders from your server; however, this now has negligible impact since it only prevents their .info files from being loaded.

  • Note: If you had a module enabled at one time, before removing it you may wish to first click the "Uninstall" tab on the admin/build/modules page, as this will allow you to remove disabled modules' database tables. Once you delete the files from the server, you won't be able to use the Uninstall tab to remove that module's information from the database.

Note that some hosts allow a php.ini file in the root of your site.

All fatal errors can result in a blank modules page. If you want to be sure if the memory limit is causing this problem, you should check your web server error logs. Hunt for a line that looks like:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 418591 bytes) in /path/to/drupal/includes/database.mysql.inc on line 29

That indicates that Drupal needed more memory than PHP was allowed to give it.

Always keep in mind that generally, "Less is More." The less memory your installation consumes, the faster it is, and the more people can visit your site at one time.

You may have to restart Apache for the configuration changes to take effect, especially if you edit php.ini.

If you get an "internal server error" message when you try to access the admin modules page, read the white screen of death WSOD page because it may be able to solve your problem.

 
 

Drupal is a registered trademark of Dries Buytaert.