<p>I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing:</p>

<pre><code>rename('/correct/path/to/dir/1', '/correct/path/to/dir/2');
</code></pre>

Try running the following script:
```
```
print_r(posix_getpwuid(getmyuid()));
print_r(pathinfo($YOUR_PATH));
```
```
And see what that returns.