SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Formerly known as RockNRollPig Shpigford's Avatar
    Join Date
    Dec 2002
    Location
    Denver, CO
    Posts
    2,877
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mkdir() is setting my ownership to nobody

    When I use the following line to create a directory it sets the ownership of that directory to nobody:

    PHP Code:
    mkdir('../games/'.$genre.'/'.$name.'/'0755); 
    The CHMOD is shown to be 755 but it won't let me modify the folder at all. What do I need to do to keep it from doing that?

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    Fredericton NB
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That means that PHP is running under user "nobody". Unfortunately I don't believe there is anything you can do about that unless you have admin rights to the server.
    Red Cow Technologies, Inc
    RealAdmin - Software For Real Estate Agents
    myBusinessAdmin - Affordable CMS and web design solution.

  3. #3
    3MTA3
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    1,016
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you checked out the user notes at:
    http://us2.php.net/manual/en/function.mkdir.php

    Also, have you tried running the chmod() function with it in the script?

  4. #4
    Formerly known as RockNRollPig Shpigford's Avatar
    Join Date
    Dec 2002
    Location
    Denver, CO
    Posts
    2,877
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ray Oliver
    That means that PHP is running under user "nobody". Unfortunately I don't believe there is anything you can do about that unless you have admin rights to the server.
    I do have admin rights, I have a dedicated server.

  5. #5
    Formerly known as RockNRollPig Shpigford's Avatar
    Join Date
    Dec 2002
    Location
    Denver, CO
    Posts
    2,877
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by devised
    Also, have you tried running the chmod() function with it in the script?
    Yeah, the chmod() function didn't do anything for me as the chmod is actually set correctly.

  6. #6
    SitePoint Addict
    Join Date
    Jan 2004
    Location
    Colorado Springs
    Posts
    308
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    chown -- Changes file owner

    Description

    int chown ( string filename, mixed user)

    <?php
    chown('/usr/tmp/file.php', 'root');
    ?>

  7. #7
    Formerly known as RockNRollPig Shpigford's Avatar
    Join Date
    Dec 2002
    Location
    Denver, CO
    Posts
    2,877
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nekeno12
    chown -- Changes file owner

    Description

    int chown ( string filename, mixed user)

    <?php
    chown('/usr/tmp/file.php', 'root');
    ?>
    PHP Code:
    Warningchown(): Operation not permitted in /home/username/public_html/admin/add-game.php on line 10 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •