[ILUG-BOM] chmod in PHP

Dinesh Shah dinesh@[EMAIL-PROTECTED]
Wed Oct 23 11:58:35 IST 2002

On Wed, 23 Oct 2002 kapil_karekar at vsnl.net wrote:

> chmod("/var/www/cgi-bin/new.dat", 0777);
> i'm getting the following error:
> Warning: chmod failed: Operation not permitted in /var/www/html/new.php on line 2
> Both the files viz. new.dat and new.php have the same owner and group.

Only owner can change the perm of the file. Also, normally Apache runs as 
nobody.nobody. So if u want to chmod using Apache/PHP the file ownership 
should nobody.nobody.

> what could be the issue? 

With regards,
--Dinesh Shah :-)
Shah Micro System
dinesh at shahmicro.com
dinesh at indiamail.com
Mobile: 098213-11906
Res: (+91-22) 6919423
Tel: (+91-22) 6747120

More information about the Linuxers mailing list