Its syntax is: int chmod (string filename, int permissions) The permissions must be specified in octal mode. <? chmod ("data.txt", 0766); // This will work ?>