我使用Doctrine 2.0与CodeIgniter集成。 尝试从数据库加载某些内容时遇到此错误。
Fatal error: Uncaught exception 'Doctrine\ORM\Proxy\ProxyException' with message 'Your proxy directory must be writable.' in /opt/lampp/htdocs/khoone/application/libraries/Doctrine/ORM/Proxy/ProxyException.php:37 Stack trace: #0 /opt/lampp/htdocs/khoone/application/libraries/Doctrine/ORM/Proxy/ProxyFactory.php(189): Doctrine\ORM\Proxy\ProxyException::proxyDirectoryNotWritable() #1 /opt/lampp/htdocs/khoone/application/libraries/Doctrine/ORM/Proxy/ProxyFactory.php(90): Doctrine\ORM\Proxy\ProxyFactory->_generateProxyClass(Object(Doctrine\ORM\Mapping\ClassMetadata), 'application/mod...', '<?php??namespac...') #2 /opt/lampp/htdocs/khoone/application/libraries/Doctrine/ORM/UnitOfWork.php(2576): Doctrine\ORM\Proxy\ProxyFactory->getProxy('Entity\Account', Array) #3 /opt/lampp/htdocs/khoone/application/libraries/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php(135): Doctrine\ORM\UnitOfWork->createEntity('Entity\User', Array, Array) #4 /opt/lampp/htdocs/khoone/application/libraries/Doctrine/ORM/Internal/Hydration/SimpleObje in /opt/lampp/htdocs/khoone/application/libraries/Doctrine/ORM/Proxy/ProxyException.php on line 37
我已将Doctine配置如下:
$models_namespace = 'Entity';
$models_path = APPPATH . 'models';
$proxies_dir = APPPATH . 'models/Proxies';
$metadata_paths = array(APPPATH . 'models/Entity');
已经尝试过这个:
sudo chmod 777 myapp/application/models/Proxies
但我还是面对错误。 任何想法可能是什么问题?
答案 0 :(得分:2)
我遇到了同样的问题。为了解决这个问题,我删除了一个名为“Cache”的文件夹,该文件夹位于我的“Data”文件夹中,它可以正常工作。