Cakephp 尝试调试cake core生成的对象时,新安装中出现内存耗尽错误

Cakephp 尝试调试cake core生成的对象时,新安装中出现内存耗尽错误,cakephp,cakephp-2.3,Cakephp,Cakephp 2.3,CakePHP2.4.3的新安装,我无法调试$this或$this->Form或任何类似的东西。我又安装了一个cake 2.1,调试这些变量效果很好。我可以在应用程序中调试基本变量,但如果我想查看实例化的蛋糕对象。。不行 以下是我的AppController配置: Error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 118015334 bytes) File: /var/www/composer.

CakePHP2.4.3的新安装,我无法调试$this或$this->Form或任何类似的东西。我又安装了一个cake 2.1,调试这些变量效果很好。我可以在应用程序中调试基本变量,但如果我想查看实例化的蛋糕对象。。不行

以下是我的AppController配置:

Error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 118015334 bytes) 
File: /var/www/composer.cakePHP/Vendor/pear-pear.cakephp.org/CakePHP/Cake/Utility/Debugger.php  
Line: 611

您可以尝试增加内存,直到您能够看到变量包含的等式:
ini_set('memory_limit','512M')

但是,$this,$this->Form是相当大的对象,您不必调试它们


您尝试过吗?

这是因为对象链可以包含循环引用,尝试打印它们会导致无限循环。除了不调试这样的对象实例之外,没有真正的解决方案。正如@cornelb指出的,尝试调试
$this
$this->Form
会输出太多信息,因此很难找到有用的调试信息

    class AppController extends Controller {
    public $helpers = array('Html', 'Form', 'Session');
    public $components = array(
            'Acl',
            'Session',
            'Auth' => array(
                    'authorize' => array(
                            'Actions' => array('actionPath' =>     'controllers')
                    )
            ),
            'DebugKit.Toolbar'
    );

    public function beforeFilter() {
        parent::beforeFilter();
        //Configure AuthComponent
        $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
        $this->Auth->logoutRedirect = array('controller' => 'users', 'action' =>     'login');
        $this->Auth->loginRedirect = array('controller' => 'adminHomes', 'action' =>     'index');

        //$this->Auth->allow('display');
        //$this->Auth->allow();
        return true;
    }
    }