Re: php exec('jsexec')ã > By: Mortifis to All on Fri Jun 12 2020 11:04 amãã > > I have a php script that calls exec('/sbbs/exec/jsexec blah blah blah',ã > > $result); but it does not return any result ... evenã > > exec('/sbbs/exec/jsexec -v', $result); does return a result ... butã > > exec('ls -ln /sbbs/exec/jsexec'); does, as do other system commands ...ã > > possible jsexec is doing something to stdout?ãã > You would to execute a script that writes to stdout (e.g. with "write",ã > "writeln" methods). The status output of jsexec won't be captured by yourã > php script since jsexec knows it's not being run from a console, itã > redirects status messages to /dev/null.ãã > digital manããmy test php script gets no $response :ãã<?phpãexec('/sbbs/exec/jsexec mytest.js "Hello World"', $response);ããforeach($response as $key => $value) {ã echo "key $key - value $value<br>";ã}ããããmytest.js:ããload("sbbsdefs.js");ããfunction dump_objs(obj) {ã Object.keys(obj).forEach(function (e) {ã writeln( e + ': ' + JSON.stringify(obj[e]));ã });ã}ããif(!argv[0]) ã writeln('No argumants ... aborting ');ãelse ã dump_objs(argv);ããany ideas?ãã---ã þ Synchronet þ Realm of Dispair BBS -
http://ephram.synchro.net:82ã
Re: Re: php exec('jsexec')ã > By: Mortifis to Digital Man on Fri Jun 12 2020 06:47 pmãã > > > Re: php exec('jsexec')ã > > > By: Mortifis to All on Fri Jun 12 2020 11:04 amãã > > > > I have a php script that calls exec('/sbbs/exec/jsexec blah blahã > > > > blah', $result); but it does not return any result ... evenã > > > > exec('/sbbs/exec/jsexec -v', $result); does return a result ... butã > > > > exec('ls -ln /sbbs/exec/jsexec'); does, as do other system commandsã > > > > ... possible jsexec is doing something to stdout?ãã > > > You would to execute a script that writes to stdout (e.g. withã > > > "write", "writeln" methods). The status output of jsexec won't beã > > > captured by your php script since jsexec knows it's not being run fromã > > > a console, it redirects status messages to /dev/null.ãã > > > digital manã > > }ãããã > > mytest.js:ãã > > load("sbbsdefs.js");ãã > > function dump_objs(obj) {ã > > Object.keys(obj).forEach(function (e) {ã > > writeln( e + ': ' + JSON.stringify(obj[e]));ã > > });ã > > }ãã > > if(!argv[0])ã > > writeln('No argumants ... aborting ');ã > > elseã > > dump_objs(argv);ãã > > any ideas?ãã > Nope, no ideas. I never tried executing jsexec from PHP.ãã > digital manããguess writing to a file and reading it back will have to do, I'll play with itãand see. Thanks Digital Man, I appreciate the reply.ãã~Mortifisãã---ã þ Synchronet þ Realm of Dispair BBS - http://ephram.synchro.net:82ã
Sysop: | Karloch |
---|---|
Location: | Madrid, Spain |
Users: | 54 |
Nodes: | 8 (0 / 8) |
Uptime: | 128:44:13 |
Calls: | 700 |
Files: | 17,895 |
D/L today: |
128 files (60,769K bytes) |
Messages: | 66,010 |