This is a good tip. Since it's hard to figure out how
to run any CGI on Apache for Windows:
  #!scripts
if you don't have /bin/sh and it's not clear how to run
a cmd script. One venturing on Apache on Window must realize
the consequences.

The following J script runs from command line, but gives
an error under Apache (same drive where Apache installed):

===============================================================
#!/j602/bin/jconsole

echo_z_=: 0 0&$@(1!:2&2)

echo 'Content-Type: text/plain',LF,LF

echo 'Hello from J',LF,LF

exit ''
===============================================================

Error Log:
[error] malformed header from script. Bad header=|domain error: test.ijs

You could configure:
  ScriptInterpreterSource Registry-Strict
and a registry key
  Shell\ExecCGI\Command

Anyway first the above script should run, then you need to resovel
PATH_TRANSLATED env variable.




> From: Joey K Tuttle <[email protected]>
> 
> I use a lot of j/cgi, but have not adopted Oleg's nice package. One 
> important point (which I have "rediscovered" too many times) is 
> illustrated by a cgi program I use for testing (with the comment 
> expressing my frustration) -
> 
> #! /usr/local/bin/ja
> stdout 'Content-type: text/html', NL,NL  NB. This line is very damn 
> important (sigh)
> stdout 'HoHoHo',NL
> exit 0
> 
> This displays text, but if the HoHoHo is replaced by a proper 
>  ... page, then it produces expected results.
> 
> IF the Content-type line is missing, OR if there are fewer than 2 new 
> lines after it, all browsers object to the dynamically created stream.
> 
> (Those 2 new line characters are what usually tripped me up)
> 
> 
> At 08:08  +0200 2009/06/22, david alis wrote:
> >A follow on to previous posting.
> >If I use http://localhost/jhp/examples/index.html
> >instead of  http://localhost/cgi-bin/jhp.cgi/examples/index.html
> >then the page does resemble Oleg's http://olegykj.sourceforge.net/jhp/
> >
> >However selecting items from the left menu only fills the panels
> >with HTML source - instead of the actual page.
> >
> >i.e. this is displayed:
> ><% ContentType'text/html' %>
> >
> >  
> >
> >
Bitmap Test
> >
Time is <%= 6!:0 '' %>
> >
Bitmap image generated by J
> >
> >
> >
> >instead of the bit pattern that ht4a.jhp produces.
> >----------------------------------------------------------------------
> >For information about J forums see http://www.jsoftware.com/forums.htm
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm



      
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to