Strict standards: Redefining already defined constructor for class Object in path\cake\libs\object.php on line 54

a 夏天 提交于 2019-12-18 16:12:33

问题


I am trying to configure MS-MSQL database on cakephp (Not mysql).

My Wampserver is 2.2e-php5.4.3-httpd2.2.22-mysql5.5.24-32b on my laptop (which is windows x64-bit.

I already invited these two dlls to run sql server
extension=php_sqlsrv_54_ts.dll
extension=php_pdo_sqlsrv_54_ts.dll

I've got these two errors in running cakephp 1.3

Strict standards: Redefining already defined constructor for class Object in C:\wamp\www\project\cake\libs\object.php on line 54<br/>
Strict standards: Non-static method Configure::getInstance() should not be called statically in C:\wamp\www\project\cake\bootstrap.php on line 38

I also install WampServer2.1e-x32 it didn't work :(

Any help plz


回答1:


you are using newer php version. in php 5.4, E_STRICT is part of E_ALL

in cake 1.3, open file /cake/bootstrap.php and change the error_reporting like this

error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);




回答2:


Your cakephp version is old, and has problems with the latest version of PHP.

You could try updating your CakePhp version. Seems that your are using the 1.3 version, so update to the latest one. You could find it

https://github.com/cakephp/cakephp/archives/1.3

Only replacing the cake/ folder with the new one, you fix this problem.

If you are new to CakePHP, then it is better to learn the Latest framework 2.2.1. You will be easily installed this framework with your Wamp.




回答3:


Go into your Config/core.php and look for the error handler configuration:

Configure::write('Error', array(
    'handler' => 'ErrorHandler::handleError',
    'level' => E_ALL & ~E_DEPRECATED,
    'trace' => true
));

and replace 'level' with this:

...
'level' => E_ALL & ~E_STRICT & ~E_DEPRECATED,
...



回答4:


The solution is to update the cake 1.3 version to the last release currently the 1.3.21 .

click here to download the last release :

https://github.com/cakephp/cakephp/tags



来源:https://stackoverflow.com/questions/12134285/strict-standards-redefining-already-defined-constructor-for-class-object-in-pat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!