使用Drupal启用Mongodb后出现500内部服务器错误

时间:2015-12-25 19:47:13

标签: php mongodb drupal-modules

在settings.php中,您必须输入类似的代码,如下所示settings.php。

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

在stderr中发送的FastCGI:" PHP消息:PHP致命错误:Class' DrupalMongoDBCache'在/var/www/drupal-test/includes/cache.inc

中找不到

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

    $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';

在stderr中发送的FastCGI:" PHP消息:PHP致命错误:require_once():无法打开所需的' 的的/ var / WWW / Drupal的测试/ Drupal的测试/位点/所有/模块/ 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';
    ?>

1 个答案:

答案 0 :(得分:0)

你使用哪个版本?它是rc2还是dev?

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