我有一个 Drupal 论坛站点,其中包含大量数据。例如,一个论坛类别有 14,000 个主题和 100,000 条评论。即使在我当地的测试站点,它也非常滞后。然后当我将它上传到一个实时站点时,它给出了这个错误:
Fatal error: Allowed memory size of 52428800 bytes exhausted (tried to allocate 40961 bytes) in /home/fmotors/public_html/development/includes/theme.inc on line 1494
所以它与增加内存限制或不一次查询所有线程有关。但我不知道该怎么做。这是标记上述错误的代码:
function theme_render_template($template_file, $variables) {
extract($variables, EXTR_SKIP); // Extract the variables to a local namespace
ob_start(); // Start output buffering
include DRUPAL_ROOT . '/' . $template_file; // Include the template file
return ob_get_clean(); // End buffering and return its contents
}
电话ob_start()
在 1494 行。顺便说一下,我正在使用 Drupal 的高级论坛模块。