CakePHP 1.1与PHP 5.3的兼容性问题

3

我刚刚从PHP 5.1升级到了5.3,并且之前在我的服务器上使用的是CakePHP 1.1。自从升级以来(或者可能更早,我不确定),我遇到了以下错误。是否有人能够帮忙解决:

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/dispatcher.php on line 157

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/dispatcher.php on line 221

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/libs/controller/controller.php on line 308

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/libs/controller/controller.php on line 347

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/libs/controller/controller.php on line 535

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/libs/controller/controller.php on line 805

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/libs/controller/component.php on line 128

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/libs/view/view.php on line 686

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/libs/class_registry.php on line 55

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/libs/model/connection_manager.php on line 84

Deprecated: Assigning the return value of new by reference is deprecated in /home/vhosts/bbblh.co.uk/httpdocs/cake/libs/model/connection_manager.php on line 107
1个回答

7

基本上意思是:你(在此情况下是CakePHP)正在尝试做的操作在当前版本中仍然有效,但在未来的PHP版本中可能会被移除。

你应该升级CakePHP到较新的版本。你也可以抑制这些警告:

error_reporting(E_ALL & ~E_DEPRECATED);

但这样做的危险在于,您可能会忘记它,下次升级php时您的网站将停止工作而没有任何警告。


赞成升级Cake。这很容易。 - Travis Leleu
1
当您升级Cake核心时,请务必检查以下内容:http://book.cakephp.org/view/411/Migrating-from-CakePHP-1-1-to-1-2和http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3 - bjudson
如果那是你唯一的错误,那么你做得很好!Cake v1.1非常陈旧。赶紧升级吧! - Leo

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接