someone correct me if i get off a little bit here....
(assuming you're using apache)...
in the apache config file, you specify a user for apache to run as... often something like 'apache' or 'nobody'. this is the "user" that is attempting to chmod your files via the PHP function. say for example you have a file with the following permissions.
Code: Select all
-rwxr-xr-x 1 will users 5288 Jun 19 14:23 index.php
if apache is running as user 'nobody' in group 'nogroup' (the default i believe), you would be unable to chmod this file since 'nobody' doesn't have permission to do anything. there is a configuration option to allow you to chmod things as root (--suexec i think), but it can cause quite a security risk.