473,472 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 52427
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.