typecho程序的error_log文件提示
程序员文章站
2022-05-29 18:36:01
...
typecho根目录下生成一个error_log文件
内容为:
内容为:
[03-Feb-2016 06:20:43 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:20:43 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:20:43 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:20:43 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
可否在/var/Typecho/Plugin.php文件中增加这一句?
error_reporting( E_ALL & ~E_STRICT );
这样有没有用,会不会对程序有影响?
回复内容:
typecho根目录下生成一个error_log文件
内容为:
[03-Feb-2016 06:20:43 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:20:43 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:20:43 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:20:43 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
[03-Feb-2016 06:24:37 UTC] PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Avatars_Plugin::avatars() should not be called statically in /home/...
可否在/var/Typecho/Plugin.php文件中增加这一句?
error_reporting( E_ALL & ~E_STRICT );
这样有没有用,会不会对程序有影响?
抑制错误的输出应该是治标不治本的~
而且尽量不要动核心代码,不然以后程序更新的时候可能会有意想不到的结果
所以我们应该从错误的根源入手:
这个报错是因为 Avatars 插件里面的 avatars() 函数没有声明成静态函数,而用 Avatars_Plugin::avatars() 的时候访问的是静态函数所以就出问题了,所以直接在 avatars 插件的 plugins.php 的 avatars 函数前面加一个 static 关键字就不会报错了
去下载了个 Avatars 插件看了看,应该是在 plugins.php 的 109 行,
把
public function avatars($size,$rating,$default,$comments){
改成
public static function avatars($size,$rating,$default,$comments){
就可以啦
推荐阅读
-
IE提示当前安全设置不允许下载该文件怎么办的2种解决方法
-
win7系统无法删除文件提示您需要权限来执行此操作的解决方法
-
Win10复制文件失败提示"错误0x80070522:客户端没有所需的特权"怎么办?
-
Python中删除文件的程序代码
-
Asp.Net程序目录下文件夹或文件操作导致Session失效的解决方案
-
rar压缩包打不开提示无法创建文件夹的原因及解决方法
-
由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射。
-
C#程序提示“正由另一进程使用,因此该进程无法访问该文件”的解决办法
-
linux下oracle报错,提示ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务的解决办法
-
解决nohup执行python程序log文件写入不及时的问题