RE: mkdir permission errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2008-07-14 at 22:09 -0400, Wei, Alice J. wrote:
> > This is the output I have got from using your script.
> > I have made a following quick change:
> >
> > [root@localhost var]# chown -R root:root .
> >
> > Not surprisingly, I am still not able to make a new directory using PHP with the HTTP.
> > Could there be anything else I missed?
> 
> I knew who you were when you were on the shell... your ps output showed
> the grep process was running as root. But as the others mentioned...
> you're running the above script as root. As soon as you go to run via
> the webserver things change. In fact, if you run the above as root, and
> create any directories, then those will inherit the root ownerships.
> Then if you run the same script via the web server, those new
> directories may be causing you issues since they trunp the webserver's
> permissions. You might want to go do some reading about *nix ownerships
> and permissions. It's quite important that you have a thorough
> understanding of those if you're going to administer the server.
> 
> Cheers,
> Rob.
> 
> The problem here is that the user is not supposed to be doing this from
> the client end. What happens here is that they execute a client script,
> which then calls the script I have been posting from a different server.
> Therefore, my guess is that I can run this "kind of" like in the command
> line and access it from the root like where my set up is.
> 
> I can see that I am having a problem here getting the script to work
> here. What is interesting is that if my web server is a problem here,
> then how is it possible that I am still able to edit the text files I
> have already created on this particular machine with the "permission
> issues" from a remote server? To get the script to work, do I need to
> edit anymore settings on my server?

How do you connect via the remote server? Presumably, in each case when
you are on the shell, you are the root user. The root user trumps all
ownerships and permissions and can do as it pleases. Also, it may be
that some of your directory creations are succeeding, while others are
failing, depending on the parent directory in which you are attempting
to create a sub-directory. You need to simplify the problem, and focus
on a single problem directory. Find one directory creation that is
failing from the webserver. Then let's deal with it. Determine this
single directory that fails due to permissions violations. Then on the
shell change to the parent directory. Once there type:

    ls -al

Note the output and the owner/group names. Please post the output. The
"." directory is the parent directory when you are within the parent
itself.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux