title: Unable to write to file programmatically on linux server
body: <p>I have a python CGI script which takes form input <code>x</code> and<code>y</code> (integers) and passes it to a C++ executable using <code>subprocess</code> in which the program writes the sum of the two values to a text file.</p>
  
  <p>The code works fine on my local machine.  However, after much testing ,I found that whenever I run this program on my server (in <code>/var/www</code>) and attempt to write the file some kind of error occurs because I get the "Internal Server Error" page.</p>
  
  <p>The server is not mine and so I do not actually have sudo privileges.  But from putty, I can manually run the executable, and it indeed writes the file.</p>
  
  <p>My guess is I have to somehow run the executable from the python script with some amount of permission, but I'm not sure.  I would appreciate any suggestions!</p>
  
  <p>EDIT:<br>
  @gnibbler:  Interesting, I was able to write the file to the /tmp directory with no problem.  </p>
  
  <p>So I think your suggestions are correct and the server simply won't allow me to write when calling the script from the browser.</p>
  
  <p>Also, I cannot access the directory with the error logs, so I will have try to get permission for that.</p>