permissions - php exec python script that writes file -


i need execute python script writes file in same directory.

test.py :

print 'hi! 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 second script not, return var $ret2 1. both commands work fine in terminal. guess permission issue php scripts executed 'nobody'.

thanks in advance

try give full path filename = 'sample.txt'

for e.g.

filename = '/home/pranjal/sample.txt' 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -