Php/cmd

Discussion in 'PHP' started by koolsamule, Sep 14, 2010.

  1. #1
    Hi Chaps,

    I'm setting up a PHP App on a new SBS2008 Server.
    My scripts use MKDIR, RENAME, etc, which I believe use the Windows Command Prompt by default to perform these functions.
    On my existing server, I have added IUSER to the security settings, but I am unable to do this on the new SBS2008 Server.
    I have read that it is advised against giving such permissions to 'Guests' to the CMD.EXE, so my question is how do I get around this.
    If PHP uses CMD, but I cannot grant permissions to, what was IUSER, how can PHP perform these actions?

    Cheers
     
    koolsamule, Sep 14, 2010 IP
  2. Thorlax402

    Thorlax402 Member

    Messages:
    194
    Likes Received:
    2
    Best Answers:
    5
    Trophy Points:
    40
    #2
    Not 100% sure of this, but in my experience then php often performs command-line actions under the "apache" user. I have never used a windows server before either, but it sounds like you might be looking for the php function system(). This function lets you run command-line operations like "mkdir" and "rn" and I assume that it would do the same on a windows machine.

    Hope this helps.
     
    Thorlax402, Sep 14, 2010 IP