title: python3 [Errno 13] Permission denied
body: <p>I have a Laravel app running on ubuntu 22.0.4. Inside one of my controllers I try to run a python script using shell_exec():</p>
  <pre><code>$output = shell_exec(&quot;python3 /home/ubuntu/test.py 2&gt;&amp;1&quot;);
  Log::debug($output);
  </code></pre>
  <p>But the script is not executed and inside my log file I get:</p>
  <pre><code>&quot;python3: can't open file '/home/ubuntu/test.py': [Errno 13] Permission denied&quot;
  </code></pre>
  <p>I have set the permission for test.py to 777, and I have tried:</p>
  <pre><code>sudo chown ubuntu:www-data test.py
  </code></pre>
  <p>and also,</p>
  <pre><code>sudo chown ubuntu:ubuntu test.py
  </code></pre>
  <p>But still the same error. I have other projects running on ubuntu 20.0.4 with the same Laravel structure and logic in which I can execute the same python script (test.py) without any problem. But, for this specific case which I am using ubuntu 22.0.4, I am facing this problem. Also, same as other projects, I used pip3 to install python3.</p>