469,609 Members | 1,437 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

rename, unlink : Permission denied XPpro, Apache, PHP 4.3.3

I've tried everything seen on Internet, but nothing works:

I'm trying to move a file from a dir to a subdir (WinXP Pro, Apache, PHP
4.3.3)

Here is the code:
chmod($XMLPath, 0777);
chmod($XMLPath.$file, 0777);
chmod($XMLPath.$successpath, 0777);

if (!rename($XMLPath.$file, $XMLPath.$successpath.$file)) //move file in
success path
if(!rename($XMLPath.$file, $XMLPath."file.old")){
if (copy($XMLPath.$file, $XMLPath.$successpath.$file))
unlink($XMLPath.$file);
}

both Rename and unlink give me Permission Denied error. The file isn't in
read only mode, and the copy works fine (so the path are right...)

Any idea ?

Jul 17 '05 #1
1 3498
Have you tired simplifying your code?

eg, just write a script that says:

unlink ("file.txt"); just wondering if you are specifying the file properly.

J.
Bob Bedford wrote:
I've tried everything seen on Internet, but nothing works:

I'm trying to move a file from a dir to a subdir (WinXP Pro, Apache, PHP
4.3.3)

Here is the code:
chmod($XMLPath, 0777);
chmod($XMLPath.$file, 0777);
chmod($XMLPath.$successpath, 0777);

if (!rename($XMLPath.$file, $XMLPath.$successpath.$file)) //move file in
success path
if(!rename($XMLPath.$file, $XMLPath."file.old")){
if (copy($XMLPath.$file, $XMLPath.$successpath.$file))
unlink($XMLPath.$file);
}

both Rename and unlink give me Permission Denied error. The file isn't in
read only mode, and the copy works fine (so the path are right...)

Any idea ?


Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by lorenzogordon | last post: by
6 posts views Thread by Benjamin | last post: by
4 posts views Thread by nitinpatel1117 | last post: by
11 posts views Thread by byteoart | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.