redeclare class condition_info

时间:2014-08-08 09:15:22

标签: php moodle

我将我的moodle从2.6.4升级到2.7.1。升级后,我有空白(白色)屏幕。然后我打开config.php

中的调试显示
$CFG->debug = 32767;
$CFG->debugdisplay = true;

之后我收到一个错误:致命错误:无法在第105行的/home/moodle/public_html/lib/conditionlib.php中重新声明类condition_info。

然后我搜索并发现可能是opcache(https://tracker.moodle.org/browse/MDL-45797)的问题。所以我按照这个文档 - http://docs.moodle.org/27/en/admin/environment/php_setting/opcache.enable并在php.ini中启用opcache:

[opcache]
opcache.enable = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 4000
opcache.revalidate_freq = 60

; Required for Moodle
opcache.use_cwd = 1
opcache.validate_timestamps = 1
opcache.save_comments = 1
opcache.enable_file_override = 0

; If something does not work in Moodle
;opcache.revalidate_path = 1 ; May fix problems with include paths
;opcache.mmap_base = 0x20000000 ; (Windows only) fix OPcache crashes with event id 487

; Experimental for Moodle 2.6 and later
;opcache.fast_shutdown = 1
;opcache.enable_cli = 1 ; Speeds up CLI cron
;opcache.load_comments = 0 ; May lower memory use, might not be compatible with add-ons and other apps.

重新加载apache但它仍然无效。我也试着评论部分;如果某些内容在Moodle 中无效,则仍会出现错误。知道什么可能是错的吗?

我还读到可能是主题的问题。在升级之前,我将主题切换为Clean,这是2.7中的默认主题。

我的ubuntu 14.04与PHP 5.5.9-1ubuntu4.3(cli)(内置:2014年7月7日16:36:58)

1 个答案:

答案 0 :(得分:2)

这可能是错误或与opcache系统不兼容。

  • 我建议关闭opcache:opcache.enable = 0。 opcache只是好的,如果一切正常并且你想获得一些额外的性能。
  • 重启PHP
  • 重启Apache

最后尝试下载之一:

如果问题仍然存在:请在moodle上打开一个新的错误报告,并参考您找到的报告。它显然是相关的。