问题
I have just upgraded from php 5.1 to 5.3 and had previously been using cakephp 1.1 on my server. Since the upgrade (or possibly earlier, I can't be sure), I'm getting the following errors. Can anyone shed some light:
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:
Basically what it says is: What you (cakephp in this case) are trying to do will still work in this version, but could be removed in future php versions.
You should upgrade cakephp to a newer version. You could also suppress the warnings:
error_reporting(E_ALL & ~E_DEPRECATED);
but the danger in doing that is that you forget about it and your site stops working without warning the next time you upgrade php.
来源:https://stackoverflow.com/questions/3620450/cakephp-1-1-with-php-5-3