<?php
$filename = "testconfig.php";
if (file_exists($filename)) {
echo "The file $filename exists<br />";
} else {
echo "The file $filename does not exist<br />";
}
echo "Attempting to chmod ".$filename;
chmod($filename, 0777);
?>
-rwxrwxrwx 1 root root 22 Jan 14 15:14 testconfig.php
[david@thebalrog:~]$ ls -l foo.txt
-rw-rw-rw- 1 root root 0 2008-01-14 20:13 foo.txt
[david@thebalrog:~]$ chmod 0777 foo.txt
chmod: changing permissions of `foo.txt': Operation not permitted
[david@thebalrog:~]$ ls -l foo.txt
-rw-rw-rw- 1 root root 0 2008-01-14 20:13 foo.txt
nuggs
PHP runs under the user: [nuggs]nuggs@localhost
Wtf?
[EDIT] Messed up quotes. Now I'm getting permission issues, see below.