简体   繁体   English

CakePhp中严格的标准错误?

[英]Strict Standards Error in CakePhp?

i am using xampp v3.1.0 3.1.0 and cakephp 1.2.10 but I've got these two errors. 我正在使用xampp v3.1.0 3.1.0和cakephp 1.2.10,但我有这两个错误。

Strict Standards: Redefining already defined constructor for class Object in E:\\xampp\\htdocs\\projectname\\cake\\libs\\object.php on line 62 严格标准:在第62行的E:\\ xampp \\ htdocs \\ projectname \\ cake \\ libs \\ object.php中重新定义类Object的已定义构造函数

Strict Standards: Non-static method Configure::getInstance() should not be called statically in E:\\xampp\\htdocs\\projectname\\cake\\bootstrap.php on line 46 严格标准:非静态方法不应在第46行的E:\\ xampp \\ htdocs \\ projectname \\ cake \\ bootstrap.php中静态调用Configure :: getInstance()

Thanks in advance 提前致谢

E_STRICT warnings are warnings, not errors - know that the problem is PHP 5.4+ specific : E_STRICT警告是警告,而不是错误 - 知道问题是PHP 5.4+特定

E_STRICT (integer) E_STRICT(整数)

Enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code. 允许PHP建议对代码进行更改,以确保代码的最佳互操作性和向前兼容性。

Since PHP 5 but not included in E_ALL until PHP 5.4.0 从PHP 5开始, 但直到PHP 5.4.0才包含在E_ALL中

you can ignore them (after taking steps to prevent users seeing them). 你可以忽略它们(在采取措施阻止用户看到它们之后)。

There are several options at your disposal, upgrading is the most appropriate. 您可以使用多种选项,升级是最合适的选择。 If it is an application you are activity maintaining - It would be best to upgrade to the current stable (2.4 at the time of writing) but if that's not the case/desirable/possible - upgrading is still the most appropriate solution: 如果它是一个你正在维护活动的应用程序 - 最好升级到当前稳定版(写入时为2.4),但如果不是这种情况/希望/可能 - 升级仍然是最合适的解决方案:

Upgrade to latest 1.3 升级到最新1.3

Recommended 推荐的

1.3.17 Is the last release in the 1.x release cycle. 1.3.17是1.x发布周期中的最后一个版本。 It is php 5.4 compatible, and includes innumerous bug and security fixes. 它与PHP 5.4兼容,并包含无数的bug和安全修复程序。 It does have some migration steps but they are typically no more than a few minutes (or at most, hours) work. 它确实有一些迁移步骤,但通常不超过几分钟(或最多,几小时)工作。 Upgrading is a simple process - just download the new version and replace the cake folder. 升级是一个简单的过程 - 只需下载新版本并替换cake文件夹即可。

Upgrade to latest 1.2 升级到最新的1.2

easy 简单

1.2.12 Is the last 1.2 minor release and is also php 5.4 compatible, upgrading to this version has no risk of compatibility problems with your existing application code. 1.2.12最后的1.2次要版本是否与PHP 5.4兼容,升级到此版本不存在与现有应用程序代码兼容性问题的风险。 Upgrading is a simple process - just download the new version and replace the cake folder. 升级是一个简单的过程 - 只需下载新版本并替换cake文件夹即可。

Silence E_STRICT warnings yourself 沉默E_STRICT警告自己

easiest (but also hacky) 最容易 (但也很hacky)

The change required to make 1.2 php 5.4 compatible is actually quite trivial - you can apply it yourself (just look for error_reporting and add & ~E_STRICT to the setting). 使1.2 php 5.4兼容所需的更改实际上非常简单 - 您可以自己应用它(只需查找error_reporting并将& ~E_STRICT添加到设置中)。 Editing the cake folder is of course not recommended - but if you're looking for the least-change solution: this is it. 当然不建议编辑蛋糕文件夹 - 但如果您正在寻找变化最小的解决方案:就是这样。

Seems that old CakePHP doesn't play very well with newer versions of PHP. 似乎旧的CakePHP在较新版本的PHP上不能很好地发挥作用。 Please have a look here: http://i.justrealized.com/2009/cakephp-php-deprecated-error-warning/ 请看这里: http//i.justrealized.com/2009/cakephp-php-deprecated-error-warning/

Be aware that CakePHP 1.2 is deprecated. 请注意,不推荐使用CakePHP 1.2。 It's recommended to use at least 1.3 if you want to stick to 1.x version, as there aren't major differences with 1.2. 如果你想坚持1.x版本,建议使用至少1.3,因为与1.2没有重大差异。

But if you still insist, you can downgrade PHP to 5.2 or lower to be compatible 但是如果你仍然坚持,你可以将PHP降级到5.2或更低以兼容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM