There are many posts about this error and the 'solution' is to add the line
ini_set('max_execution_time', 240);
to the default/settings.php. (Or updating php.ini)
That will work but it is no real solution. The program remains slow, specially if you choose Administration and some chooses within as Modules.
The problem is depending on the used Modules in the sites/all/modules and is different for every installation of Drupal. There are many modules with many directories that all will be searched by Drupal when you choose i.e. Administration / Modules.
My solution is to do the search-action in the (stand-alone) program create_allmodules.php. That works on the original way to get the relevant directories. It creates the file allmodules.txt.
This program must be run manually every time if you remove or add or update one module in sites/all/modules.
The second (and last) part is one change in the file includes/file.php, to use the allmodules.txt file (if it exists). The performance is much better, all actions within 30 seconds.
I have also tested (on drupal 7.0) the change before updating file.php with the file timeout.php. You can use this program to check the change before you are using it. With "$manier = 0;" you will get information about the working with the current file.php, it also creates the file allmodules.txt.
With "$manier = 1;" you will get information about the working with the suggested file.php, it works with the file allmodules.txt.
I have in the directory sites/all/modules 949 directories, with 12 relevant for the search. When you have more directories than 949 your program will be slower.
The search is also done for drupal/modules, but that has only 74 directories (with 63 relevant), it is possible to create here another file allmodules.txt, but that will not really save time.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | timeout_Drupal78.zip | 24.64 KB | hanv3 |
| #3 | timeout.zip | 24.26 KB | hanv3 |
| timeout.zip | 24.26 KB | hanv3 |
Comments
Comment #1
damien tournoud commentedYou probably are hitting #1081266: Avoid re-scanning module directory when a filename or a module is missing.
Comment #2
hanv3 commentedThat is a quick reaction.
I am not sure if this (missing modules) is the problem. With the ini-set line added, the program is still working and responding after a minute (or two). I don't see anything special in the Modules page (or on different places).
I thought that the great number of directories (939) in just one module (CiviCRM), was the problem.
(They are examined in the function file_scan_directory())
I will take a good look at your link, it is new for me and it looks very big and impressive.
Comment #3
hanv3 commentedUpgrade zip.file to Drupal 7.2
Comment #4
hanv3 commentedUpgrade for Drupal 7.8