Codeigniter和教义500内部错误 [英] Codeigniter and Doctrine 500 internal error

查看:72
本文介绍了Codeigniter和教义500内部错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我已经将教义和Codeigniter结合起来了,我想我已经快到了。
Codeigniter的版本为2.0.2,而Doctrine的版本为2.0.0。

I've tried to combine Doctrine with Codeigniter and I'm almost there, I think. The version of Codeigniter is 2.0.2 and from Doctrine is 2.0.0.

现在的问题是,使用冲洗功能时出现500个内部服务器错误()的方法。

The problem is now that I get an 500 internal server error using the flush() method of Doctrine.

我正在按照教程(http://wildlyinaccurate.com/integrating-doctrine-2-with-codeigniter-2/)进行安装与codeigniter的学说。但是在最后一步,它只是失败了,我也不知道为什么。

I am following a tutorial (http://wildlyinaccurate.com/integrating-doctrine-2-with-codeigniter-2/) to install doctrine with codeigniter. But at the last step it just fails and I don't know why.

这是我在控制器中的代码:

This is my code in my controller:

$app = new models\application;
$app->setName("Test applicatie");
$app->setGuid();

$this->doctrine->em->persist($app);
$this->doctrine->em->flush(); //If I comment this out, it loads the view...

$this->load->view('welcome_message');

当我注释掉flush方法时,它将加载视图。

When I comment out the flush method it loads the view.

谢谢。

推荐答案

好吧,因为 $ this-> -> em-> flush(); 实际上是对数据库的写操作,请确保您具有执行数据库操作所需的MySQL用户权限。

Well, since $this->doctrine->em->flush(); is what actually does the write to the DB, Make sure you have the required MySQL user rights to do the DB action.

直接在MySQL中编写查询,并确保没有在此处引发错误。

Write the query directly in MySQL and make sure that the error isn't thrown there.

这篇关于Codeigniter和教义500内部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆