title: Permissions issues when using python through PHP
body: <p>I need to have my Python program open a file, use some of the data in it, and spit out a different file. I'm having several issues, and was hoping if someone could definitively tell me if they are permissions based and if so, how to fix them. My Python program works through the terminal.</p>
  
  <p>Here are some areas I've identified where it doesn't work:</p>
  
  <pre><code>import matplotlib.pyplot
  infile = open('/correct_pathway/textfile1.txt','r')
  outfile = open('/correct_pathway/textfile2.txt','w')
  </code></pre>
  
  <p>It is having troubles on all of these separately. I didn't know there could be permissions issues while importing a module, but there are. Also the files are globally read/writable that it is trying to open.</p>
  
  <p>EDIT: Sorry, that was unintentionally vague and had a typo in the code that was not actually there. The PHP code as written on the webpage is as follows (it works if I call in a much simpler python program, so there is no problem I can think of here):</p>
  
  <pre><code>&lt;?php  $command= '/usr/bin/python /correct_pathway/program.py';
  $temp = exec($command, $output);
  print_r($temp); ?&gt;
  </code></pre>
  
  <p>The code is supposed to open the infile, read a number off of it, and then write that number to the outfile as well as print off a different number. The printed number should be displayed on the webpage. This all works fine through the terminal, just not on the webpage. </p>
  
  <p>Thanks in advance!</p>