The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mkdir() Not Working

Discussion in 'General Discussion' started by donnie, Sep 12, 2003.

  1. donnie

    donnie Active Member

    Joined:
    May 23, 2003
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    uk
    I have Linux RedHat 7.3 server. Previously I have enabled the Safe mode On. But now I have switch the safe_mode off and check it by running the following PHP code:
    PHP:
    <?
            if (
    get_cfg_var("safe_mode") == 1)
        {
            echo 
    "safe mode is on";
        }
        else
        {
            echo 
    "safe mode is off";
        }
    ?>    
    It's returning 'safe mode is off'. But when I run the mkdir() command to make the directory from php it will give me an Error: 'Permission denied'. The code which I executed is:
    PHP:
    <?    $madedir mkdir("abc" 0777) == TRUE 0;
        if(
    $madedir == 0)
        {
            echo 
    "Dir Not Created";
        }
        else
        {
            echo 
    "Dir Created";
        }
    ?>
    It's also giving an Error: 'Permission denied'.

    I have check it but it's not running any Safe Mode Disabled Commands. Please tell me, if you have an idea what's the problem.
     
    #1 donnie, Sep 12, 2003
    Last edited: Sep 12, 2003
  2. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    unless your running phpsuexec the dir it's trying to write inside must have 777 permissions... or be owned by user.nobody and have 770 perms.

    cPanel.net Support Ticket Number:
     
  3. donnie

    donnie Active Member

    Joined:
    May 23, 2003
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    uk
    Thanks a lot. I already got my mistake.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page