Re: problems with rename() - permission denied

From: Date: Tue, 25 Mar 2003 10:35:16 +0000
Subject: Re: problems with rename() - permission denied
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-140931@lists.php.net to get a copy of this message
"Christian Rosentreter" wrote: Hi Christian, > I've a small problem, which mades me crazy... :\ > > I'm trying to rename() a swapfile to real destination file (atomic update). > It works on differnt environments very well. Sadly not on my ISP-server > I've added an "chmod($swapfile,0777)", but this has not solve the problem. > The directories have all FULL access (read, write, etc.). The destiniation file too. I don't want 2 use the copy/unlink solution.... Do anyone have an idea? > > /* this fails with "Permission denied" */ > rename($swapfile,$filename); > > /* ... but this works */ > copy($swapfile,$filename); > unlink($swapfile); I'm just speculating, but it's possible that your ISP is running from multiple machines: i.e. several webservers feeding off one fileserver. I had a similar problem with one of the sites that I work on, and that was the case. Might be worth asking your ISP if this is the case. The only solution in my case was to go the copy() unlink() way. It's not as if it's a huge workaround. ;) James

« previous php.general (#140931) next »