title: From which directory to run python Script in webserver
body: <p>I am trying to run a python script from a webserver(apache) using php. I used the following command </p>
  
  <p>exec (python test.py $arg1 $arg2 , $output, $result)</p>
  
  <p>It executes successfully when I put the test.py in the document root directory. However, I wanted to run the python script from another subdirectory so that it would be easy for me to manage the outout of the python script.</p>
  
  <p>what the python script does is</p>
  
  <ol>
  <li>creates a folder</li>
  <li>copy a file from the same directory the python script resides into the folder created (1)</li>
  <li>zip the folder</li>
  </ol>
  
  <p>The document root and the subdirectory for the python script have the same permission.</p>
  
  <p>since it keeps on looking for the files to be copied from the documentroot, it generates "no such file or directory" error (in the apache error log file)</p>