如何消除php5严格标准错误?

How to eliminate php5 Strict standards errors?(如何消除php5严格标准错误?)
本文介绍了如何消除php5严格标准错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

将我的 PHP 升级到 5.4.3(WAMP 服务器 2.2)后,我在 CakePHP 1.3 中制作的网络应用程序在我的索引中显示以下错误:

After upgrading my PHP to 5.4.3 (WAMP server 2.2), my web app made in CakePHP 1.3, is showing the following errors in my index:

严格标准:重新定义类的已定义构造函数对象在 C:...cakecakelibsobject.php 第 63 行

Strict standards: Redefining already defined constructor for class Object in C:...cakecakelibsobject.php on line 63

严格的标准:非静态方法 Configure::getInstance() 应该不会在 C:...cakecakeootstrap.php 第 49 行中静态调用

Strict standards: Non-static method Configure::getInstance() should not be called statically in C:...cakecakeootstrap.php on line 49

我发现有些人通过将 php.ini 中的 error_reporting 设置为 E_ALL & 来解决这个问题.~E_STRICT.

I've found that some people solve this problem by setting the error_reporting in php.ini to E_ALL & ~E_STRICT.

我在计算机上的两个 php.ini 文件(C:wampinphpphp5.4.3 和 C:wampinapacheapache2.4.2in)中都这样做了,但没有解决问题.

I did that in both php.ini files (C:wampinphpphp5.4.3 and C:wampinapacheapache2.4.2in) present on my computer but it didn't solve the problem.

我也尝试将 php_value error_reporting 6143 放入 C:...cake.htaccess 但没有成功.

I also tried to put php_value error_reporting 6143 in C:...cake.htaccess but without success.

有谁知道我该如何解决这个问题?由于 firebird,我无法升级我的 CakePHP.

Does anybody know how can I solve this? I can't upgrade my CakePHP because of firebird.

推荐答案

php 5.4 的变化之一是 E_STRICT 现在是 E_ALL 的一部分

One of the changes in php 5.4 is that E_STRICT is now part of E_ALL

因此,在您的/cake/bootstrap.php 中,您可以从错误报告中删除 E_STRICT:

So, in your /cake/bootstrap.php you could remove the E_STRICT from your error reporting:

error_reporting(E_ALL ^ E_STRICT);

并再次兼容 5.4 之前的版本.

and be compatible again with before 5.4 versions.

这篇关于如何消除php5严格标准错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)