zoukankan      html  css  js  c++  java
  • PHPCMS 错误日志 Only variables should be passed by ...

    有几个网站是PHPCMS V9做的,但这两天发现一个问题,PHPCMS 的错误日志超过了20M ,后台报警,然后我看了下错误日志,其中两万多行都是一个错误,错误信息如下:


    1 <?php exit;?>11-03 10:24:46 | 2048 | Only variables should be passed by reference | caches/caches_model/caches_data/content_output.class.php | 79

    然后查找 根源 caches/caches_model/caches_data/content_output.class.php 的第79行

    1 extract(string2array($this->fields[$field]['setting']));

    PHP extract() 函数从数组中把变量导入到当前的符号表中。
    对于数组中的每个元素,键名用于变量名,键值用于变量值。


    于是我怀疑extract()的参数不是数组 造成的。

    由于报错的这个位置试过缓存文件,找到源文件的位置为

    网站根目录/phpcms/modules/content/fields/box/output.inc.php

    修改文件里面的


    1 extract(string2array($this->fields[$field]['setting']));
    为:
    1 $setting = string2array($this->fields[$field]['setting']); is_array($setting) && extract($setting);


    这样,先判断下extract()的参数是不是一个数组,如果是数组的话,才执行extract(),这样就避免错误,

    然后在PHPCMS 更新缓存,这样后面就不会报错了

  • 相关阅读:
    计算机基础总结
    Apache安装错误 APR not found解决方法
    一、编译错误
    2.2 进程控制之进程共享
    2.1 进程控制之fork创建子进程
    ARM串口控制终端命令
    u-boot、kernel、root系统烧写和挂载命令命令
    8.1 编写USB鼠标驱动程序,并测试
    八、USB驱动分析
    Source Insight的使用
  • 原文地址:https://www.cnblogs.com/wawahaha/p/3547415.html
Copyright © 2011-2022 走看看