Warning: chmod(): Operation not permitted

matrixx

Verified User
Joined
May 24, 2004
Messages
314
Location
London, UK
CentOS 4
PHP Version 4.3.11
Safemode OFF
http://www.securenetwork3.com/phpinfo.php

One of our users has a chmod command in a php script and it kicks out the following errors..


Warning: chmod(): Operation not permitted in
/home/jcurtis/domains/curtis-associates.co.uk/public_html/surveys/medieval/p
rocess.php on line 92

Warning: chmod(): Operation not permitted in
/home/jcurtis/domains/curtis-associates.co.uk/public_html/surveys/medieval/p
rocess.php on line 109

Warning: Cannot modify header information - headers already sent by (output
started at
/home/jcurtis/domains/curtis-associates.co.uk/public_html/surveys/medieval/p
rocess.php:92) in
/home/jcurtis/domains/curtis-associates.co.uk/public_html/surveys/medieval/p
rocess.php on line 121

Anyone got any ideas?

Cheers,

Rob
 
What file/directory is the script trying to chmod? My first guess would be that the user running the script (apache) doesn't have privileges to chmod the file/directory (probably owned by the user).
 
ballyn said:
What file/directory is the script trying to chmod? My first guess would be that the user running the script (apache) doesn't have privileges to chmod the file/directory (probably owned by the user).

It's a text file, the script (all looks ok) chmods it to 755, writes and then chmods it back to 600

Rob
 
We've seen similar problems with Mambo, which we resolved by running a cronjob to automatically chmod the proper directories from time to time.

Jeff
 
Hello,

You could put an @ (error suppression flag) infront of each of the CHMOD commands on lines 92 and 109 of /home/jcurtis/domains/curtis-associates.co.uk/public_html/surveys/medieval/process.php.

At least that will get rid of the error and allow PHP to sucessfully modify the headers it wants to change. :)

Good luck!
 
safe_mode on and/or chmod() or related functions being disabled in the php.ini might cause this problem.
 
Do you mean that if safe_mode is set as on server wide and then disabled for the individual user it would keep the chmod from working?

:(

Jeff
 
Back
Top