typecho程序的error_log文件提示
程序员文章站
2022-05-19 07:55:39
...
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){
就可以啦
推荐阅读
-
优酷客户端提示:程序运行错误 是否重试的解决办法
-
系统提示“您的网卡驱动程序不正常!”怎么办 是什么原因
-
chm文件显示“此程序无法显示网页”的五种解决办法
-
PDF文件打不开提示正在准备再循环的问题解决方法
-
火车头升级提示未能找到文件Database.xml的解决方法
-
未能加载文件或程序集 HRESULT:0×80131047错误的解决办法
-
xfs文件系统提示没有磁盘空间错误的解决方法
-
win7系统电脑提示找不到rundll32.exe应用程序的四种原因和解决方法图文教程
-
Win7系统提示Windows Defender无法扫描选定的文件的原因及解决方法图文教程
-
电脑中SQL提示未能加载文件mscorlib.tlb的解决方法