-1

大規模なデータを含む 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 のアドバンス フォーラム モジュールを使用しています。

4

1 に答える 1

0

構成またはインデックス ファイル セットで

ini_set('memory_limit', 0);
于 2013-04-15T12:58:47.673 に答える