Python cgi Apache os.system()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • naima.mans@gmail.com

    #1

    Python cgi Apache os.system()

    Hello :)

    I have installed Apache on windows...
    The server work well, and my python script also

    but when I want in my python script to run a System command like
    os.system(my_co mmand) the script doesn't do anything!

    here the error.log

    [Wed Nov 08 14:19:30 2006] [error] [client 127.0.0.1] The system cannot
    find the drive specified.\r, referer:


    When i run the python script manually it works!

    i think it's a user access probleme but i don't know how to resolve it
    !

    please help ....
    thanks

  • Cameron Walsh

    #2
    Re: Python cgi Apache os.system()

    naima.mans@gmai l.com wrote:
    Hello :)
    >
    I have installed Apache on windows...
    The server work well, and my python script also
    >
    but when I want in my python script to run a System command like
    os.system(my_co mmand) the script doesn't do anything!
    >
    here the error.log
    >
    [Wed Nov 08 14:19:30 2006] [error] [client 127.0.0.1] The system cannot
    find the drive specified.\r, referer:

    >
    When i run the python script manually it works!
    >
    i think it's a user access probleme but i don't know how to resolve it
    !
    >
    please help ....
    thanks
    >
    Without knowing what "my_command " is, all I can suggest is that
    "my_command " might be referring to a file that is in your user path, but
    not in the path of the user used to run apache or python (which could be
    "nobody").

    Depending on how securely your server is configured, you may be able to
    access whichever file it is looking for if you specify the full path to
    the file, or the relative path from the server root directory (watch out
    for hardlinks/softlinks.)

    Cameron.

    Comment

    • naima.mans@gmail.com

      #3
      Re: Python cgi Apache os.system()

      Hello

      thanks for your help..

      it was a problem of path as you mentionned... my command was "O:\\....
      ccm start" and i have change it with the path of the drive O

      thanks a lot
      have a good day

      Tachi

      Comment

      Working...