【问题标题】:redeclare class condition_info重新声明类 condition_info
【发布时间】: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) 中的任何代码。

标签: php moodle


【解决方案1】:

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

  • 我建议关闭 opcache:opcache.enable = 0。只有在一切正常并且您想获得一些额外性能的情况下,opcache 才是好的。
  • 重启 PHP
  • 重启 Apache

最后尝试以下下载之一:

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

【讨论】:

  • @repincln 嗨,有人能告诉我在哪里写opcache.enable = 0 吗?
  • 在你的php配置文件中:php.ini
猜你喜欢
  • 2023-04-03
  • 2013-02-25
  • 1970-01-01
  • 1970-01-01
  • 2013-08-07
  • 2011-03-22
  • 2023-03-29
  • 2016-02-24
  • 2018-02-16
相关资源
最近更新 更多