Execute python script with output from php
<p>Is there any special permission or setting in order to execute a python script that create a new file or image? 
This is my code:</p>

<pre><code>&lt;?
function py(){
    exec( 'python my_script.py');
    echo "ok";
}

py();
?&gt;
</code></pre>

<p>And this is my python script (an example):</p>

<pre><code>#!/usr/bin/python
import sys

f = open('out.txt', 'w')
print &gt;&gt; f, 'thats all'
f.close()
</code></pre>

<p>Running php i get "ok" message but no file is created. What am i doing wrong?</p>

<p>Setting the right permissions to file and folders did the trick.</p>

<p><a href="http://i.stack.imgur.com/fuXCb.png" rel="nofollow"><img src="http://i.stack.imgur.com/fuXCb.png" alt="enter image description here"></a></p>

<p>On Mac OS: Alt + Click on "+", then search for _www and add World Wide Web Server to users giving read and write permission. Same for the root folder.</p>

php python