Saturday, 15 January 2011

Running a PHP script that runs a Python script that runs a bash script, hangs on bash -



Running a PHP script that runs a Python script that runs a bash script, hangs on bash -

i have python script encoding video , calling shell script uploads new video dropbox. works fine command line needed create others execute have php script calling python script.

i don't want php script run forever (it takes 15-30 mins complete), want kick off python script , done. figured out need create happen , said works on command line. when called via php, video encodes file never uploads. can see dropbox script kicked off , listed process using percent of cpu, percent never changes, seems stuck/dead.

the command looks this, beingness run using cmd()

script.py -options &>/logs/phptopython.log &

the shell script kicked off using popen

any suggestions?

thanks

it sounds permissions issue. double check permissions on directory trying upload video. if on linux can modify permissions on directory this:

chmod 755 /path/to/dir

this gives file owner read, write , execute permissions (7). grouping , other users read , execute permissions (5).

apache running different user when run command in bash. quick test see if it's permission issue grant 777 on directory. wouldn't leave way though – it'd way identify if permissions issue.

if script works 777 permissions, either alter owner of directory user apache runs or add together apache user directory's grouping , grant grouping write permisssions.

edit: noticed said utilize cmd(), i'm guessing on windows. comments might still relevant chmod command won't work on windows.

php python bash shell

No comments:

Post a Comment