Symfony Cache doctrine/orm/Proxies failed to open stream /Proxy/AbstractProxyFactory.php on line 209(Symfony Cache 学说/orm/Proxies 未能在第 209 行打开流/Proxy/AbstractProxyFactory.php)
问题描述
我正在尝试将 symfony 移动到共享主机.
I'm try to move symfony to shared host.
我将 symfony 结构移到/并且我的 web 文件夹是/public_html.
I moved symfony structure to / and my web folder is /public_html.
警告:需要(/home/user/app/cache/prod/doctrine/orm/Proxies/__CG__UserBundleEntityUser.php):无法打开流:/home/user/vendor/doctrine/common 中没有这样的文件或目录/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php 第 209 行
Warning: require(/home/user/app/cache/prod/doctrine/orm/Proxies/__CG__UserBundleEntityUser.php): failed to open stream: No such file or directory in /home/user/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209
警告:需要(/home/user/app/cache/prod/doctrine/orm/Proxies/__CG__UserBundleEntityUser.php):无法打开流:/home/user/vendor/doctrine/common 中没有这样的文件或目录/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php 第 209 行
Warning: require(/home/user/app/cache/prod/doctrine/orm/Proxies/__CG__UserBundleEntityUser.php): failed to open stream: No such file or directory in /home/user/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209
致命错误:require(): 无法打开所需的 '/home/user/app/cache/prod/doctrine/orm/Proxies/__CG__UserBundleEntityUser.php' (include_path='.:/opt/php55/lib/php') 在/home/user/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php 第 209 行
Fatal error: require(): Failed opening required '/home/user/app/cache/prod/doctrine/orm/Proxies/__CG__UserBundleEntityUser.php' (include_path='.:/opt/php55/lib/php') in /home/user/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 209
此错误仅发生在 prod
环境中.dev
环境中不会引发异常.
This error occurs only in the prod
environment. The exception is not thrown in the dev
environment.
我尝试了以下方法:
rm -rf /app/cache + chmod 777
app/console cache:warmup
我使用 Symfony 2.8.3.以下目录存在于本地和服务器上:
I use Symfony 2.8.3. The following directories are present locally and on the server:
本地缓存:-/annotations,/twig,/vich_uploader +/doctrine,/translations
LOCAL CACHE: - /annotations, /twig, /vich_uploader + /doctrine, /translations
服务器缓存:-/annotations,/twig,/vich_uploader
SERVER CACHE: - /annotations, /twig, /vich_uploader
如果我将本地缓存上传到服务器,异常就会消失.
If I upload my local cache to the server, the exception disappears.
推荐答案
您在尝试访问应用程序之前没有创建代理类.这通常由以下人员完成:
You did not create the proxy classes before you tried to access your application. This is usually done by:
app/console cache:warmup --env=prod
prod
环境中默认禁用代理类的自动生成.您可以通过将其添加到您的配置来启用类似于 dev
环境的代理类的自动生成:
The auto-generation of proxy-classes is disabled by default in the prod
environment. You can enable automatic generation of proxy-classes similar to the dev
environment by adding this to your config:
app/config/config_prod.yml
doctrine:
orm:
auto_generate_proxy_classes: true # <- change to true
proxy_dir: '%kernel.cache_dir%/doctrine/orm/Proxies'
proxy_namespace: Proxies
这篇关于Symfony Cache 学说/orm/Proxies 未能在第 209 行打开流/Proxy/AbstractProxyFactory.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Symfony Cache 学说/orm/Proxies 未能在第 209 行打开流/Proxy/AbstractProxyFactory.php
基础教程推荐
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01