You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2011/03/02 20:29:26 UTC

DO NOT REPLY [Bug 50814] SSI exec not working on Windows (Apache 2.x)

https://issues.apache.org/bugzilla/show_bug.cgi?id=50814

--- Comment #5 from RW Sagraves <ki...@gmail.com> 2011-03-02 14:29:23 EST ---
Some updates about trying to use ssi exec after doing some more 
experimentation with this:

I still have not been able to use exec to invoke an .exe and see its output 
but have been able to use it to show some output from an invoked Windows batch 
file.  If Windows internal commands (ex: dir, ver, vol, date /t, time /t) are 
invoked within the batch file then their output will appear in the .shtml page. 
However, I have not been able to get the output of external commands
(ex: hostname.exe, netstat.exe, ipconfig.exe, etc.) that are invoked from the 
batch file to appear.  I have tried various .exe invocations from within the 
batch file to no avail (ex: 'hostname.exe', 'cmd /c hostname.exe', etc.).

Any thoughts on how to get the output of a .exe using the ssi exec?

Below is an example of the latest test files and output.  You can see that
hostname.exe produced no output either when invoked directly by exec or
when used within the batch file.  However, hostname.exe does produce output to
the console when the ssitest.cmd is invoked directly on the command-line.


index.shtml
---------------------------------------------------------
<br/>
<!--#set var="FOOBAR" value="SSI is working" -->
<!--#echo var="FOOBAR" -->
<br/>
<pre>
Here is output from exec of 'd:\temp\ssitest.cmd': &gt;&gt;<!--#exec
cmd="d:\temp\ssitest.cmd" -->&lt;&lt;
</pre>
<br/>
Here is output from exec of 'c:\windows\system32\hostname.exe':
&gt;&gt;<!--#exec cmd="c:\windows\system32\hostname.exe" -->&lt;&lt;
<br/>



ssitest.cmd batch file (invoked by within index.shtml by exec):
---------------------------------------------------------------
@echo off
@echo "ssitest.cmd ran"
dir
hostname.exe
@echo on



Output seen in my browser (for http://localhost/index.shtml):
------------------------------------------------------------
SSI is working 

Here is output from exec of 'd:/temp/ssitest.cmd': >>"ssitest.cmd ran"
 Volume in drive D is D_DRIVE
 Volume Serial Number is 14E9-D859

 Directory of D:\Apache_2217\htdocs

03/02/2011  01:50 PM              .
03/02/2011  01:50 PM              ..
06/22/2010  04:46 PM                20 cache2.html
11/20/2004  03:16 PM                44 index.html
03/02/2011  01:53 PM               363 index.shtml
03/02/2011  01:24 PM               575 index.shtml_sav
02/17/2011  10:49 AM               614 index.shtml_test1
02/21/2011  11:25 AM               323 index.shtml_use
               6 File(s)          1,939 bytes
               2 Dir(s)  420,219,654,144 bytes free
<<


Here is output from exec of 'c:\windows\system32\hostname.exe': >><<

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org