I need to execute a python script that writes a file in the same directory.
test.py :
print 'Hi! I was executed'
test2.py :
filename = 'sample.txt'
target = open(filename,'a')
target.write("Something Something")
target.close()
Php script:
<?
exec('python test.py',$output1,$ret1);
exec('python test2.py',$output2,$ret2);
?>
The first exec works fine but the second script does not, the return var $ret2 is 1. Both the commands work perfectly fine in the terminal. I guess it is a permission issue as php scripts are executed as 'nobody'.
Thanks in advance