1

Following a Doctrine / CodeIgniter tutorial

Everything is good up until the very end when I try to insert data through my controller

    $user = new Entities\User;
    $user->setFirstName('Joel');

    $this->doctrine->em->persist($user);

I get:

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

This might be due to a difference in the tutorial version of Doctrine vs. the current version as noted here, but the tutorial version is no longer supported by Doctrine and I'm not sure what to change.

4

2 回答 2

3

您是否通过在某处设置代理目录:

// set up proxy configuration
$config->setProxyDir(APPPATH.'models/Proxies');
$config->setProxyNamespace('Proxies');

您的代理目录设置有问题。检查代理目录是否定义正确以及该目录是否存在。

希望这可以帮助。

于 2012-12-27T18:15:59.413 回答
-1

看起来像权限问题:

为了修复,我做了

sudo chown -R www-data:www-data 。

于 2015-09-07T19:11:01.933 回答