[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with compiled CGI programs under Pi3Web




This mail attempts to address one of the most frequently encountered
problems with generating CGI programs for Pi3Web, specifically
CGI programs that have been compiled to a windows .exe file from C
or C++ source.

Feel free to add your own comments.

John

--------

Problem:
--
CGI programs compiled from C or C++ always fail. A server error is
given or the server hangs until a timeout occurs. The included
CGI programs (Hello.exe, Redirect.exe) work fine as included but
not when recompiled from source.

Issue:
--
CGI programs must be compiled as 32 bit windows executables. Some
older compilers generate windows 16 bit executables. Because of 
limitations of 16 bit applications they cannot function correctly
as CGI programs (regardless of HTTP server). Some compilers which
commonly cause problems are DJGCC/G++, Turbo C++ and Quick C.

Solution:
--
There is no known workaround to this problem. Try to use a 
native 32 bit compiler. If this is not possible consider the
windows CGI protocol which was specifically design to overcome 
limitations of 16 bit windows environments. Consider programming
in Perl (32 bit versions of perl for windows available from
www.activestate.com). Alternatively consider something like fastcgi.