tartan75 Posted January 4, 2010 Share Posted January 4, 2010 I'm moving webserver (now on my own VPS), and am having problems with an htdig wrapper. the wrapper takes a search requests, runs htsearch by exec function, then parses the results. However the exec function it only returns the text/html header returned by htsearch, not the rest of the results. having spent some time debuging i have established: 1) the VPS is running suphp, therefore (verified by exec(whoami) the code is being run as user alpha. 2) to debug I have hard coded the command into the exec function. 3) to verify that its not an htsearch or user permissions problem i've copied the command from my php code to the shell prompt (while logged in as user alpha), and it runs returning the full results. 4) php returns line 1 (header), and the blank line 2 only. The remaining page of lines is (somewhat fustratingly not returned. 5) to verify that it is not being returned (and not a case of me not correctly handling it once returned), I've also tried passthru with the same results. exec('/usr/bin/htsearch -c /home/psalmsin/htdig/conf/htdig.conf words=psalm',$result); if ($Debug) { while (list($k,$v) = each($result)) { echo "$k -> $v \n<BR>"; } Any advice would be much appreciated. Link to comment https://forums.phpfreaks.com/topic/187156-exec-function-doesnt-return-expected-results-to-output/ Share on other sites More sharing options...
tartan75 Posted January 9, 2010 Author Share Posted January 9, 2010 I've looked into this more and the commend seams to process up to the first space, so /usr/bin/htsearch runs, but not /usr/bin/htsearch -c /home/psalmsin/htdig/conf/htdig.conf words=psalm I'm confused. Any suggestions much appreciated Link to comment https://forums.phpfreaks.com/topic/187156-exec-function-doesnt-return-expected-results-to-output/#findComment-991640 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.