Php 条令2无法找到代理目录(CodeIgniter)
遵循条令/代码点火器 在我尝试通过控制器插入数据之前,一切都很好Php 条令2无法找到代理目录(CodeIgniter),php,codeigniter,orm,doctrine,doctrine-orm,Php,Codeigniter,Orm,Doctrine,Doctrine Orm,遵循条令/代码点火器 在我尝试通过控制器插入数据之前,一切都很好 $user = new Entities\User; $user->setFirstName('Joel'); $this->doctrine->em->persist($user); 我得到: Fatal error: Uncaught exception 'Doctrine\ORM\Proxy\ProxyException' with message 'You must co
$user = new Entities\User;
$user->setFirstName('Joel');
$this->doctrine->em->persist($user);
我得到:
Fatal error: Uncaught exception 'Doctrine\ORM\Proxy\ProxyException' with message 'You must configure a proxy directory. See docs for details' in C:\wamp\www\ci\application\libraries\Doctrine\ORM\Proxy\ProxyException.php on line 33
( ! ) Doctrine\ORM\Proxy\ProxyException: You must configure a proxy directory. See docs for details in C:\wamp\www\ci\application\libraries\Doctrine\ORM\Proxy\ProxyException.php on line 33
这可能是由于Doctrine的教程版本与当前版本有所不同,但Doctrine不再支持教程版本,我不确定要更改什么。您是否通过执行以下操作来设置代理目录:
// set up proxy configuration
$config->setProxyDir(APPPATH.'models/Proxies');
$config->setProxyNamespace('Proxies');
代理目录的设置有问题。
检查代理目录是否定义良好,并且该目录是否存在
希望这能有所帮助。看起来像是权限问题: 为了解决这个问题,我做了 sudo chown-R www数据:www数据
发现了问题,你给我指出了正确的方向。因为我没有APC缓存,我不得不注释掉这些行,但是因为创建者没有在if/else周围使用括号,它将我的代理声明作为else块。愚蠢的速记,谢谢你的帮助。