Python cgi Apache os.system()

Cameron Walsh cameron.walsh at gmail.com
Wed Nov 8 21:30:15 EST 2006


naima.mans at gmail.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_command) 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:
> http://127.0.0.1/cgi-bin/extract_source.py
> 
> 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.



More information about the Python-list mailing list