473,408 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

chmod & Operation not permitted

For a longtime, I'm searching the answer for the error
Warning: chmod failed: Operation not permitted in /xxx/xxx/ 'cos I
never get success with chmod on the servers I've tried.

Now, while searching the php.notes archives, I came across a note
(http://groups.google.com/groups?thre...0rack1.php.net)
that says it is a server/rights problem. But, I could see the note is
deleted (is because it is not true??!!).

Like to know other PHP coders comments. TIA

---
"If there is a God, he must be a sadist!"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #1
2 52425
R. Rajesh Jeba Anbiah <ng**********@rediffmail.com> wrote:
For a longtime, I'm searching the answer for the error
Warning: chmod failed: Operation not permitted in /xxx/xxx/ 'cos I
never get success with chmod on the servers I've tried.

Now, while searching the php.notes archives, I came across a note
(http://groups.google.com/groups?thre...0rack1.php.net) that says it is a server/rights problem. But, I could see the note is
deleted (is because it is not true??!!).

Like to know other PHP coders comments. TIA


Hi,

It is very simple really, the user the web server runs as (e.g. www, apache
or nobody) must have the rights to change the mode of the file or
directory.
If safe_mode is enabled, the web server's user must be owner of the file or
directory.

Little example. Let's say there is a file called input.txt and the web
server runs as "www", group "www". Safe mode is disabled.

Here you couldn't change the mode or even write the file as it is only
readable by the group "www":
4 -rw-r--r-- 1 jon www 20 Oct 14 15:30 input.txt

Here you can, as the group "www" has write permission - but only if
safe_mode is off:
4 -rw-rw-r-- 1 jon www 20 Oct 14 15:30 input.txt

Here the file is actually owned by "www" which gives the PHP script full
control even if safe_mode is enabled:
4 -rw-r--r-- 1 www www 20 Oct 14 15:30 input.txt

JOn

Jul 17 '05 #2
Jon Kraft <jo*@jonux.co.uk> wrote in message news:<bn*************@ID-175424.news.uni-berlin.de>...
R. Rajesh Jeba Anbiah <ng**********@rediffmail.com> wrote:
For a longtime, I'm searching the answer for the error
Warning: chmod failed: Operation not permitted in /xxx/xxx/ 'cos I
never get success with chmod on the servers I've tried.

Now, while searching the php.notes archives, I came across a note

(http://groups.google.com/groups?thre...0rack1.php.net)
that says it is a server/rights problem. But, I could see the note is
deleted (is because it is not true??!!).

Like to know other PHP coders comments. TIA


Hi,

It is very simple really, the user the web server runs as (e.g. www, apache
or nobody) must have the rights to change the mode of the file or
directory.
If safe_mode is enabled, the web server's user must be owner of the file or
directory.

Little example. Let's say there is a file called input.txt and the web
server runs as "www", group "www". Safe mode is disabled.

Here you couldn't change the mode or even write the file as it is only
readable by the group "www":
4 -rw-r--r-- 1 jon www 20 Oct 14 15:30 input.txt

Here you can, as the group "www" has write permission - but only if
safe_mode is off:
4 -rw-rw-r-- 1 jon www 20 Oct 14 15:30 input.txt

Here the file is actually owned by "www" which gives the PHP script full
control even if safe_mode is enabled:
4 -rw-r--r-- 1 www www 20 Oct 14 15:30 input.txt


Thanks a lot. Indeed, yours explanation is the only explanation that
I've seen on the net.

---
"Every one has the right to refute any opinion. But no one has the
right to prevent its expression"---Periyar, Famous Tamil Rationalist
Email: rrjanbiah-at-Y!com
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Daniel | last post by:
Hi, From what I read from the PHP manual, chmod on a Windows platform should have no effect, and that seems totally normal (unless someone on sourceforge has a windows port of that!). I...
2
by: Phil Powell | last post by:
exec("chmod 0644 $fyl 2>&1"); This PHP command, as you know, will evoke an EXEC to do CHMOD on the command line. Everything works fine, including printing the appropriate error message piped...
3
by: dan glenn | last post by:
(PHP 4.3.4) THIS IS DRIVING ME NUTS! I have a website where I offer members their own bit of webspace to use and am coding a very simple 'filemanager' that allows a user to upload, delete, and...
6
by: Ask Josephsen | last post by:
Hi NG If I write the following: <?php $file="myfile.JPG"; if ( getmyuid()==fileowner ( $file ) ) { chgrp ( $file, getmygid() ); chown ( $file, getmyuid() );
4
by: pdav | last post by:
Hi! Is there any solution to create a directory with one script with mkdir(), and then write a file (or move an uploaded file) in this directory with another script? The problem is, that the...
4
by: cover | last post by:
I have two distinctively different pieces of equipment that I'm trying to build a database for, each having 20 inputs which makes my mysql table 40 fields wide. Form one is for 'shakers' and...
3
by: Rik | last post by:
Hello, first of all, my provider sucks, newsserver is down for the #nth time now, offcourse when I have an urgent question.... So this will be me first time using Google Groups, forgive me if...
30
by: Alf P. Steinbach | last post by:
I once suggested in that SomeOne Else(TM) should propose a string value class that accepted literals and char pointers and so on, with possible custom deleter, and in case of literal strings just...
1
by: lawrence k | last post by:
I've a simple script to transfer some files from one domain to another, with both domains living on the same server. The files in both directories are already chmod 777. Yet after transfer, I try...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.