“拒绝访问”在Symfony中上传文件时出现“重命名”错误 [英] "Access denied" error on 'rename' call when uploading files in Symfony

查看:180
本文介绍了“拒绝访问”在Symfony中上传文件时出现“重命名”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Win7 / Apache 2.2 / ZendStudio环境中开发一个Symfony项目,并且我的文件上传工作正常。

我的目标是让用户创建一个可以包含任意多个文档的新实体(基于 http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html )。我有一个表单类型包含一个集合类型的字段(基于在 http://symfony.com/doc/current/cookbook/form/form_collections.html )。到现在为止还挺好。通过jQuery我可以任意添加许多表单作为工作正常的子表单。但是,当我提交我的表单,经常(但并非总是)我得到以下异常:
$ b

警告:rename(C:/ Programming /Servers/Apache2.2/htdocs/Symfony/app/cache/dev/doctrine/orm/Proxies\__CG__MyMainBundleEntityRecruiter.php.507bf02e30df69.85090364,C:/Programming/Servers/Apache2.2/htdocs/Symfony/app/cache /dev/doctrine/orm/Proxies\__CG__MyMainBundleEntityLecture.php):Zugriff verweigert(code:5)in C:\ Program \Servers\Apache2.2\htdocs\Symfony\vendor\doctrine\ orm \lib\Doctrine\ORM\Proxy\ProxyFactory.php line 194



Zugriff verweigert 是拒绝访问的 的德语。奇怪的是,这些文件似乎被重命名并保存在正确的位置。

为什么我得到这个异常,是否与我的环境有关,我该如何解决?我想这个问题是相关的 Symfony警告:重命名(../app/cache/dev,../app/cache/dev_old):拒绝访问。 (Code:5),但不太清楚它是否与其他情况下的情况相同。我也遇到了这个环节中描述的问题。



在此先感谢。

解决方案发现这个同时寻找相同的答案,这似乎是一个Windows +主义的问题



有更多详细信息的信息票据



TLDR:基本上,代理正试图重命名那些仍在使用的文件,在linux中工作,但并不总是在Windows上。


I'm working on a Symfony project in a Win7/Apache 2.2/ZendStudio environment and I have some trouble getting my file uploads to work properly.

My goal is to let the user create a new entity which can contain arbitrary many "Documents" (based on the article found at http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html). I have a form type containing one field of type 'collection' (based on the article found at http://symfony.com/doc/current/cookbook/form/form_collections.html). So far so good. Via jQuery I can add arbitrarily many forms as subforms which works fine. But when I submit my form, very often (but not always!) I get the following exception:

Warning: rename(C:/Programming/Servers/Apache2.2/htdocs/Symfony/app/cache/dev/doctrine/orm/Proxies\__CG__MyMainBundleEntityRecruiter.php.507bf02e30df69.85090364,C:/Programming/Servers/Apache2.2/htdocs/Symfony/app/cache/dev/doctrine/orm/Proxies\__CG__MyMainBundleEntityLecture.php): Zugriff verweigert (code: 5) in C:\Programming\Servers\Apache2.2\htdocs\Symfony\vendor\doctrine\orm\lib\Doctrine\ORM\Proxy\ProxyFactory.php line 194

Zugriff verweigert is German for Access denied. Weirdly, the files seem to get renamed and saved at the right location nevertheless.

Why do I get this exception, does it have something to do with my environment and how can I fix it? I guess this issue is related to Symfony Warning : rename (../app/cache/dev , ../app/cache/dev_old ) : Access Denied . (Code : 5), but not quite sure whether it's the same as it happens in another context. I do also encounter the problem described in this link, though.

Thanks in advance.

解决方案

Found this while looking for same answer, it seems to be a windows + Doctrine issue

Doctrine Ticket with more detailed info

TLDR: Basically the proxy is trying to rename a file thats still being used, works in linux but not always on windows.

这篇关于“拒绝访问”在Symfony中上传文件时出现“重命名”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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