title: Running a python file with www-data returning permission denied
body: <p>I am wanting to restart a python script from PHP.</p>
  
  <p>I have created the shell script:</p>
  
  <pre><code># kill script
  `which pkill` -f "$script"
  
  # start script
  `which python` "$script" &gt; /dev/null &amp;
  </code></pre>
  
  <p>when I execute this with www-data (PHP [<code>shell_exec()</code>]) I get the error:</p>
  
  <blockquote>
    <p>/usr/bin/python: can't open file '<code>$script</code>': [Errno 13] Permission denied</p>
  </blockquote>
  
  <p>and the permissions of the '<code>$script</code>' is:</p>
  
  <pre><code>-rwxrwxrwx 1 www-data www-data
  </code></pre>
  
  <p>The script is not in <code>/var/www</code> and nor do I want it to be.</p>