您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Strict Standards问题,帮忙看下

2024/5/12 14:31:10发布17次查看
我用的是php5.4.刚安装了scws分词模块,但是运行时出现如下情况:
strict standards: redefining already defined constructor for class pscws3 in d:\php\wamp\www\scws\pscws3.class.php on line 145
strict standards: redefining already defined constructor for class pscws23_dict in d:\php\wamp\www\scws\dict.class.php on line 48
strict standards: redefining already defined constructor for class xdb_dictionary in d:\php\wamp\www\scws\dict.class.php on line 148
strict standards: redefining already defined constructor for class dba_dictionary in d:\php\wamp\www\scws\dict.class.php on line 201
strict standards: redefining already defined constructor for class sql_dictionary in d:\php\wamp\www\scws\dict.class.php on line 257
strict standards: redefining already defined constructor for class txt_dictionary in d:\php\wamp\www\scws\dict.class.php on line 315
strict standards: redefining already defined constructor for class xdb_r in d:\php\wamp\www\scws\xdb_r.class.php on line 34
php.ini中的错误报告error_reporting我也改了,我将error_reporting = e_all & ~e_notice直接去掉了,还是没用,请问这该怎么解决。分词功能都能实现,就是出现上面的错误报告。
回复讨论(解决方案) 只能说你的设置并没有生效,你是否重启过apahce, php-fpm呢? 或者你修改的php.ini并非当前解释器所使用的那个(具体可看phpinfo()中的configure file项指定的配置文件位置)
你也可以安装scws 1.2.0版来解决这些问题 
2012-3-29: scws-1.2.0 released.
1) 修改 php 扩展代码以兼容支持 php 5.4.x
2) 修正 php 扩展中 scws_get_tops 的 limit 参数不允许少于 10 的问题
3) libscws 增加 scws_fork() 从既有的 scws 实例产生分支并共享词典/规则集,主要用于多线程开发。
4) 新增部分版本的 win32 的 dll 扩展,详见下载页面
回一楼:  我用的是wampserver软件,我就在安装目录中改的,改了之后重启了下,没用,
出了点小问题,删干净了,在安装一下,就好了...
是不是有同名的函数 什么的 自己检查一下看看。
另外有没安装那个zend guard 是的话卸载了看看
我将error_reporting = e_all & ~e_notice直接去掉了,还是没用
你这是什么意思?
注释掉 error_reporting,即不设置 error_reporting 时,php 将按默认的最严格的方式检查错误
对于 strict standards 类型错误,php5.3 默认不检查,而php5.4默认检查
开发环境中一般应有
error_reporting = e_all | e_strict
这样可以发现你的程序隐患
关于出错的原因:
在 pscws3.class.php 中
82行 class pscws3
103行 function pscws3($dictfile = '')
145行 function __construct($dictfile = '') { $this->pscws3($dictfile); }
其中103行的方法名 pscws3 与类名相同,被视为构造函数(兼容php4)
145行又声明了构造函数(php5)
所以出错
在不改动代码的情况下,可令
error_reporting = e_all & ~e_strict
来回避此错误
实际应用时应在公共代码中加入 
error_reporting( e_all & ~e_strict );
而不是修改 php.ini
因为你可能没有修改 php.ini 的权限;其他应用可能需要另外的配置
谢谢各位的帮助,我已经按照你们的方法试了,没有用。我吧我php.ini中的相关代码给你们看下:
; error_reporting
;   default value: e_all & ~e_notice
;   development value: e_all | e_strict
;   production value: e_all & ~e_deprecated
希望能帮我在想个法子
不是已经跟你说了吗?
在 php.ini 中令
error_reporting = e_all & ~e_strict
或在程序中执行
error_reporting( e_all & ~e_strict );
你的方法我试过了,我把改后的给你看下:;error_reporting = e_all & ~e_strict
;   default value: e_all & ~e_notice
;   development value: e_all | e_strict
;   production value: e_all & ~e_deprecated
然后我写了如下测试代码:
segment($string);
print_r($res);
?>
。测试效果还是老样子
我把所有的构造函数都改了,换了个函数名为非构造函数,错误就消失了,但是我不希望用这种方式,我还是希望能用构造函数
error_reporting 函数的设置优先于 php.ini 中的 error_reporting 设置
虽然你在 php.ini 中用 error_reporting = e_all & ~e_strict 屏蔽了 e_strict 级别错误
但你在程序中的 error_reporting(e_all ^ e_notice); 又将其打开了
error_reporting( e_all & ~e_strict & ~e_notice );
多谢多谢,现在终于解决了。谢谢六楼帮忙。嘿嘿。
我也是有这个问题
strict standards: redefining already defined constructor for class pscws4 in c:\xampp\htdocs\pscws4\pscws4.class.php on line 120
strict standards: redefining already defined constructor for class xdb_r in c:\xampp\htdocs\pscws4\xdb_r.class.php on line 34
你是按那个办法解决的?
我也是有这个问题
strict standards: redefining already defined constructor for class pscws4 in c:\xampp\htdocs\pscws4\pscws4.class.php on line 120
strict standards: redefining already defined constructor for class xdb_r in c:\xampp\htdocs\pscws4\xdb_r.class.php on line 34
你是按那个办法解决的?
我也遇到这个问题,然后在php.ini中改错误报告级别也没用,是因为文件中的error_reporting()设置级别高于php.ini中,所以需要直接更改文件中的error_reporting级别来屏蔽strict standards提示
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product