Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2002
    Location
    Columbus, OH
    Posts
    5

    Permissions Help!

    Ok... I am having a lot of trouble with file permissions now. It seems to be hating me. So that isnt really good. I do not have root access and it wouldnt let me chown it either. SO WTF??

    Here is my scripting:

    mkdir.php
    ---------------------------------------
    <?php
    function createhost($dir) {
    mkdir($dir, "777");
    $site = "http://www.brokenformula.com/stat.php";
    $id = "6";
    $bannerlne1 = "Chris Crothers";
    $bannerlne2 = "740.881";
    $html="<html><head><meta http-equiv='Content-Language' content='en-us'><meta http-equiv='Content-Type'content='text/html; charset=windows-1252'><title>Live Sales Clerk</title></head><body topmargin='0' leftmargin='0'><table border='0' width='100%%' height='100%%' cellspacing='0' cellpadding='0'><tr><td width='100%%' valign='top' height='491'><iframe src='$site' border='0' height='100%%' width='100%%' name='content'></iframe></td></tr><tr><td width='100%%' valign='top' height='61'><table border='0' width='100%%' height='100%%' cellspacing='0' cellpadding='0'><tr><td width='21%%' bgcolor='#000080'><p align='center'><img border='0' src='http://www.domain.com/images/BannerLeft2.GIF'></td><td width='57%%' valign='top' bgcolor='#000080'><p align='center'><font color='#FFFFFF' size='4'>$bannerlne1<br>$bannerlne2</font></td><td width='22%%' bgcolor='#000080'><p align='center'><a href='http://www.domain.com/demo.php?id=$id'><img border='0' src='http://www.domain.com/images/BannerRight2.GIF'></a></td></tr></table></td></tr></table></body></html>";
    //$file = fopen("index.php", "a+");
    //fwrite ($file,$html);
    //fclose($file);
    }
    $email = "[email protected]";
    createhost("./$email");
    ?>
    ------------------------------
    end of mkdir.php



    output of file permissions
    --------------------------------
    total 40
    drwxr-Sr-t 2 nobody livesale 4096 Sep 16 18:43 [email protected]
    drwxrwsr-x 2 livesale livesale 4096 Sep 16 18:57 chad
    d-w--wx-wT 2 nobody livesale 4096 Sep 16 18:09 [email protected]
    drwsrwxrwt 2 nobody livesale 4096 Sep 16 18:17 [email protected]
    -rw-rw-r-- 1 livesale livesale 1229 Sep 16 17:40 createfile.php
    d-w--wx-wT 2 nobody livesale 4096 Sep 16 17:48 help
    -rw-r--r-- 1 nobody livesale 1102 Sep 16 18:34 index.php
    -rw-rw-r-- 1 livesale livesale 1447 Sep 16 18:43 mkdir.php
    -rw-rw-r-- 1 livesale livesale 231 Sep 16 17:30 showsource2.php
    -rw-rw-r-- 1 livesale livesale 149 Sep 16 17:31 showsource.php
    ---------------------------------
    end of output of file permissions


    I cannot delete directories or anything b/c they have stuff in them. Well I go in with my FTP program and it says there isnt anything in there. So... i SSHed into the box and tried going to the folder and it said I do not have permission. I know its because I do not "own" it. Well I tried to do a chown livesalesclerk help and it said that I didnt have permission. SO... WTF? I don't have root access to the box either. Its on a shared server. Great company we are with its just I don't think I know what I am doing. So is there something that I can do? Thanks!

    Chad R. Smith

  2. #2
    Join Date
    Mar 2001
    Posts
    351
    to create a dir it's:

    mkdir("the_dir", 0777);

  3. #3
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    35

    function createhost($dir) {
    mkdir($dir, "777");
    PHP Code:
    function createhost($dir) { 
    mkdir("$dir"0777); 
    EZScripts - Quality PHP Scripts, Low Price (includes Custom Scripting on request.)
    http://www.EZScripts.net/

  4. #4
    Join Date
    Sep 2002
    Location
    Columbus, OH
    Posts
    5
    One problem is still who owns the folder. It keeps saying "nobody" where it should be livesalesclerk.... any way to fix that?

    Chad

  5. #5
    php has been installed as an apache module. when this is the case, all scripts run as the user that the apache daemon runs as...quite often this is "nobody" or "apache" or "www". so, when you run "mkdir" the directory will be created with the ownership of the user that runs the apache daemon. as far as i know, there is no way around this....

  6. #6
    Join Date
    Sep 2002
    Location
    Columbus, OH
    Posts
    5
    YOU ROCK MAN! I didn't know that at all! We do have a www folder but it does run as "Nobody". I was thinking there had to be a way to do a chown or something that could be done. But our server wouldnt take that either. I think its kinda crap though. Php should built something into it (I would but no idea how) so we can run chown's on the folders except we cannot put them to "Root" b/c that would REALLY fk things up eh? Ok man take it easy and thanks again!

    Chad

Posting Permissions

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