I am trying to run fossil within a cgi script using the "http" subcommand.  Fossil thinks it is in cgi mode and gives error "no such file: http".  That is, it thinks the "http" subcommand is the location of the script file required for cgi mode operation.

When I unset the GATEWAY_INTERFACE env variable, I get a "404 not found" error.

When I unset all environment variables, fossil reverts to the above "no such file: http" error.

After scanning the ticket database, I tried the "-nocgi" option in various positions and permutations in the command (as its use is undocumented, even in the ticket introducing it), but nothing I tried worked.

My code works flawlessly when run from a command line.  How do I convince fossil it really shouldn't be running in cgi mode?