开发者

Cakephp error [Deprecated: Assigning the return value of new by reference is deprecated in]

I'm using XAMPP with PHP 5.3.1 on my local server, my Cake project use "1.2.0.6311 beta", was all ok, but now i get this error msg

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\rh_pura\cake\libs\debugger.php on line 100

Deprecated: Assigning the return value of n开发者_如何学Pythonew by reference is deprecated in C:\xampp\htdocs\rh_pura\cake\libs\cache\file.php on line 91

Fatal error: Class 'Router' not found in C:\xampp\htdocs\rh_pura\cake\dispatcher.php on line 333

in my other server is all ok too, can someone help me?


I Solved:

Open cake/libs/configure.php and find the line "error_reporting(E_ALL);" replace that line with the following:

error_reporting(E_ALL & ~E_DEPRECATED);

And about the fatal error, just deleted all the files in /tmp

Thanks! :)


The first two are just warnings and can be ignored. Basically the code is doing osmething like

 $myobj =& new SomeObj;

which in PHP5 is no longer necessary - objects are passed around as references by default and the & is no longer necessary.

The fatal error, however, is unfixable as-is - somewhere you're missing a cake class file (not included? not installed?)


if you are just starting with cake, which it seems is the case, you should not be using 1.2 beta, instead checkout 1.3.7.

Even if you are not new to cake, and this is an already existing application you should be using 1.2.9 the upgrade should be painless as there is nothing that breaks backwards compatibility for minor releases.

You should always be using cake as a git repo, so you can just check out what ever version you like and try it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜