问题描述
您好,
我非常感谢您对以下问题的任何见解:
我已经运行PHP了在IIS上很好(OS:Server 2003,SP1; IIS:6.0; PHP:
4.3.11)。
在PHP中,用户上传文件然后处理,然后将
内容插入到用PHP创建的新文件中到服务器上。
这个位工作正常,新的正确存储由PHP创建的文件。
稍后,一旦用户确认上传并且PHP将文件的内容
插入到数据库中,代码尝试通过unlink()函数删除之前在
PHP中创建的文件。
我在屏幕上看到的内容如下:权限被拒绝
我已经确保创建(并且试图删除)该文件的Internet帐户的权限对
$具有完全权限b $ b此特定文件夹及其中的文件。但是用户必须拥有
权限,因为他们可以在
的第一名创建此文件。
我'看过PHP中文件的权限,其内容为:0666。
所以everthing *对我来说是好的;我无法看到许可证问题
来自哪里。
任何人都有任何想法?
TIA,
Lorenzo。
Hi there,
I''d greatly appreciate any insights into the following problem:
I''ve got PHP running fine on IIS (OS: Server 2003, SP1; IIS: 6.0; PHP:
4.3.11).
In PHP, the user uploads a file, which is then processed and the
contents are inserted into a new file, created in PHP, onto the server.
This bit works fine, the new file created by PHP is correctly stored.
Later, once the user confirms the upload and PHP inserts the contents
of the file into the DB, the code tries to remove the file created in
PHP moments earlier, via the unlink() function.
What I see on screen is the following: Permission denied
I have made sure that the permissions for the Internet account that
created (and is trying to delete) the file have full permissions over
this particular folder and the files within it. But the user must have
permission anyway, because they are able to create this file in the
first place.
I''ve looked at the permissions for the file in PHP, which read: 0666.
So everthing *appears* ok to me; I can''t see where the permission issue
is coming from.
Anyone got any ideas?
TIA,
Lorenzo.
推荐答案
这只是一个疯狂的猜测,但是如果你用fopen打开文件,例如,
然后让它在没有fclose的情况下打开,当文件打开时你试图
取消链接,文件被认为是不可移动的,因为它正在被php使用。
这样的事情可能是什么原因?
-
En ole paha ihminen,mutta omenat ovat elinkeinoni。 -Perttu Sirvi?
| Gedoon-S @ IRCnet | rot13(xv *** @ bhgbyrzcv.arg)
This is just a wild guess, but if you open the file with fopen, for example,
and then leave it open without fclose, and while the file is open you try to
unlink it, the file is concidered unremovable because it''s in use by php.
Could something like this be the reason?
--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirvi?
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
这篇关于PHP / IIS:文件读/写正常,文件取消链接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!