Page 1 of 1

Problems with chmod()

Posted: Mon Oct 04, 2010 3:00 pm
by EDUARD59
I am trying to change the file permissions of the file "contador.txt" with the following program:

<?php
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors',true);
chmod("contador.txt",0777);
?>

The file contador.txt is in the same directory of the script.
But I can't change the file permissions ant the following message appears:

Warning: chmod():Operation not permitted in /usr/www/htdocs/eduardo/cambia.php on line 5

What can I do? Please help

Re: Problems with chmod()

Posted: Mon Oct 04, 2010 6:10 pm
by Jonah Bron
A quick search found that that function could be disabled in your php.ini. The other possibility is that you don't have permission to chmod that file.

Re: Problems with chmod()

Posted: Tue Oct 05, 2010 3:59 am
by VladSun
Warning: chmod():Operation not permitted in /usr/www/htdocs/eduardo/cambia.php on line 5
means that you are not the owner of the file you are trying to chmod.