将我的 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严格标准错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
不能使用 'Object 作为类名,因为它是保留的Cannot use #39;Object as class name as it is reserved Cake 2.2.x(不能使用 Object 作为类名,因为它是保留的 Cake 2.2.x)
OAuth 重定向后会话丢失Session is lost after an OAuth redirect(OAuth 重定向后会话丢失)
Cakephp 3.x 中的分页排序Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分页排序)
CakePHP 多个应用程序的共享核心CakePHP Shared core for multiple apps(CakePHP 多个应用程序的共享核心)
在 CakePHP 3 上登录 [ Auth->identify() ] 始终为 falLogin [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登录 [ Auth-identify() ] 始终为 false)
致命错误:允许的内存大小为 134217728 字节已用尽Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命错误:允许的内存大小为 134217728 字节已用尽