By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.