【发布时间】:2014-08-08 09:15:21
【问题描述】:
我将 moodle 从 2.6.4 升级到 2.7.1。升级后我有空白(白色)屏幕。然后我在config.php中打开调试显示
$CFG->debug = 32767;
$CFG->debugdisplay = true;
之后我收到一个错误:致命错误:无法在第 105 行的 /home/moodle/public_html/lib/conditionlib.php 中重新声明 class 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)
【问题讨论】:
-
你在你的 php 代码中重新声明你的类。
-
我没有更改下载的 tar 文件 (moodle-latest-27.tgz) 中的任何代码。