CakePHP错误: An internal error has occurred

标签 cakephp internal-server-error

我在 cakephp 中有一些代码会产生错误。

这是 PHP Controller :

$this->loadModel( 'Vote' ); //Newly added by amit start
$vote=$this->Vote->getVote($id,$uid);
$this->set('vote',$vote);
$voteCount = count($vote);
$this->set('voteCount',$voteCount);

$voteShow = $this->Vote->find('all', array(
    'fields' => array('SUM(Vote.score)   AS score','count(id) as countId'),
     'conditions'=>array('Vote.type_id'=>$id),
));
$this->set('voteShow',$voteShow);

型号:

public function getVote($id,$uid) {
    if (empty($conditions))
        $conditions = array('Vote.type' => 'blog',
                            'Vote.type_id' => $id,
                            'Vote.user_id' => $uid);

    $users = $this->find('all', array('conditions' => $conditions,
        'order' => 'Vote.id desc'
    ));
    return $users;
}

该代码产生此错误:

Error : An internal error has occurred

这个错误是什么意思?

最佳答案

我在 core.php 中启用了 Debug模式:Configure::write('debug', 2);,它解决了我的问题。

关于CakePHP错误: An internal error has occurred,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20303117/

相关文章:

php - CakePhp 3.x、TCPDF、htmlspecialchars

database - 由于缺乏 ENUM 支持,CakePHP 的数据库表过多

JQuery - ASP.NET Web 服务 (.asmx) - 内部服务器错误 (500)

php - 奇怪的 500 内部服务器错误(firebug、php、display_errors、ajax)

apache - Perl 库无法在 WampServer 上运行

php - CakePHP:在插入数据之前向外部 API 发出请求

CakePHP Auth 手动登录

php - CakePHP:什么应该进入/Lib vs/Vendor vs/Plugin

CakePHP 内部服务器错误仅针对某些用户,清除缓存后消失