title: How to make PHP execute Python3 script as root?
body: <p>I want PHP to execute a Python3 script.
  I have done</p>
  
  <pre><code>$command = escapeshellcmd('pathtofile.py');
  $output = shell_exec($command);
  echo $output;
  </code></pre>
  
  <p>But whenever the script is run, I get an error <code>:Permission Denied</code>. </p>
  
  <p>I'm running a web server (Apache2 on Ubuntu 18.04) and the VPS has only one user- root.</p>
  
  <p>I have also done<code>chmod +x path.py</code> and added the shebang line in the scipt.</p>
  
  <p>Basically, the script is run when a user successfully registers.</p>