【问题标题】:500 Internal Server Error after enabling Mongodb with Drupal使用 Drupal 启用 Mongodb 后出现 500 内部服务器错误
【发布时间】:2015-12-25 19:47:12
【问题描述】:

在 settings.php 中,你必须输入与 settings.php 类似的代码。

我在 nginx 日志文件中收到一个错误,显示它找不到 DrupalMongoDBCache 的路径。

FastCGI 在标准错误中发送:“PHP 消息:PHP 致命错误:在 /var/www/drupal-test/includes/cache.inc 中找不到类 'DrupalMongoDBCache'

如果我准确地更改以下路径,那么我会得到一个不同的错误:

    $conf['cache_backends'][] = '/var/www/drupal-test/sites/all/modules/mongodb/mongodb_cache/mongodb_cache.inc';

    $conf['session_inc'] = '/var/www/drupal-test/sites/all/modules/mongodb/mongodb_session/mongodb_session.inc';

FastCGI 在 stderr 中发送:“PHP 消息:PHP 致命错误:require_once(): Failed opening required ' /var/www/drupal-test/ drupal-test/sites/all/modules/mongodb/mongodb_cache/mongodb_cache.inc'

注意它会复制相同的起始路径两次。为什么!?我需要 php 才能进入正确的目录,以免出现这个 500 内部错误问题。 请帮忙=)

将代码复制到settings.php:

    #MongoDB
    $conf['mongodb_connections'] = array(
    'default' => array(                             // Connection name/alias
    'host' => 'localhost',                       // Omit USER:PASS@ if Mongo isn't configured to use authentication.
    'db' => 'tomsadvice-mongodb'                   // Database name. Make something up, mongodb will automatically create the database.
    ),
    );
    include_once('.includes/cache.inc');

    # -- Configure Cache
    $conf['cache_backends'][] = 'sites/all/modules/mongodb/mongodb_cache/mongodb_cache.inc';
    $conf['cache_class_cache'] = 'DrupalMongoDBCache';
    $conf['cache_class_cache_bootstrap'] = 'DrupalMongoDBCache';
    $conf['cache_default_class'] = 'DrupalMongoDBCache';

    # -- Don't touch SQL if in Cache
    $conf['page_cache_without_database'] = TRUE;
    $conf['page_cache_invoke_hooks'] = FALSE;

    # Session Caching
    $conf['session_inc'] = 'sites/all/modules/mongodb/mongodb_session/mongodb_session.inc';
    $conf['cache_session'] = 'DrupalMongoDBCache';

    # Field Storage
    $conf['field_storage_default'] = 'mongodb_field_storage';

    # Message Queue
    $conf['queue_default_class'] = 'MongoDBQueue';
    ?>

【问题讨论】:

    标签: php mongodb drupal-modules


    【解决方案1】:

    您使用哪个版本?是rc2还是dev?

    如果您使用的是开发版,请尝试使用 rc2 版。

    【讨论】:

      猜你喜欢
      • 2019-07-19
      • 1970-01-01
      • 2019-03-21
      • 1970-01-01
      • 2016-06-23
      • 2023-03-10
      • 1970-01-01
      • 2020-08-04
      • 1970-01-01
      相关资源
      最近更新 更多