create directory in Linux

Discussion in 'PHP' started by rasel200209@gmail.com, May 30, 2010.

  1. #1
    I have add this line in using visudo command
    nobody ALL=NOPASSWD: /bin/mkdir

    ##/etc/sudoers

    Now trying to execute this php script:

    $output = shell_exec('mkdir /home/aaaa');
    echo "<pre>$output</pre>";

    But the directory is not created
     
    rasel200209@gmail.com, May 30, 2010 IP
  2. SwedBo

    SwedBo Peon

    Messages:
    77
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Regardless of the need for password, sudo prefix is a must.
     
    SwedBo, May 30, 2010 IP
  3. abstractworld

    abstractworld Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    check permissions of the folder you are creating directory in...
    or use chmod to set permissions
     
    abstractworld, May 30, 2010 IP
  4. Dizzie

    Dizzie Member

    Messages:
    71
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    make sure that the command shell_exec() is enabled by your host. Most host now disable that function. check your php configuration file to see if its disabled. You can also try
     
    Dizzie, May 31, 2010 IP