ESQL/C CGI help needed
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I am trying to use esql/c to write CGI programs for using HTML forms as front-end to a database in Informix. After I compile the program and make it into an executable, if i run it from command prompt in the cgi-bin directory, the HTML statements are printed out fine, but when i try to run the program from the browser i get an Internal Server Error (HTTP 500) and the following error message: [Mon Jan 11 15:12:10 1999] HTTPd: malformed header from script /usr/local/etc/httpd/cgi-bin/extagenhtml2 ld.so.1: extagenhtml2: fatal: libixsql.so: can't open file: errno=2 I am able to execute the program correctly at the command prompt in cgi-bin directory without any errors.I have also linked the dynamic informix esql library using the LD_LIBRARY_PATH environment variable. What could be the problem? I would be thankful for any response. -Karthik E-Mail: kramac1@unix1.sncc.lsu.edu
You must print out "Content-type: text/html\\n\\n" when printing to a browser from a cgi program. There are other content types as well. On Tue, 12 Jan 1999, Karthik Ramachandran wrote: > > I am trying to use esql/c to write CGI programs for using HTML forms as > front-end to a database in Informix. After I compile the program and make > it into an executable, if i run it from command prompt in the cgi-bin > directory, the HTML statements are printed out fine, but when i try to run > the program from the browser i get an Internal Server Error (HTTP 500) and > the following error message: > [Mon Jan 11 15:12:10 1999] HTTPd: malformed header from script > /usr/local/etc/httpd/cgi-bin/extagenhtml2 > ld.so.1: extagenhtml2: fatal: libixsql.so: can't open file: errno=2 > > I am able to execute the program correctly at the command prompt in > cgi-bin directory without any errors.I have also linked the dynamic > informix esql library using the LD_LIBRARY_PATH environment variable. > What could be the problem? > > I would be thankful for any response. > > -Karthik > E-Mail: kramac1@unix1.sncc.lsu.edu > > > Rob Wilson rwilson@informix.com
Karthik Ramachandran wrote: > I am trying to use esql/c to write CGI programs for using HTML > forms as front-end to a database in Informix. After I compile the > program and make > it into an executable, if i run it from command prompt in the cgi-bin > directory, the HTML statements are printed out fine, but when i try to run > the program from the browser i get an Internal Server Error (HTTP 500) and > the following error message: > [Mon Jan 11 15:12:10 1999] HTTPd: malformed header from script > /usr/local/etc/httpd/cgi-bin/extagenhtml2 > ld.so.1: extagenhtml2: fatal: libixsql.so: can't open file: errno=2 > > I am able to execute the program correctly at the command prompt in > cgi-bin directory without any errors.I have also linked the dynamic > informix esql library using the LD_LIBRARY_PATH environment variable. > What could be the problem? Environment, environment, environment. The web server doesn't pass LD_LIBRARY_PATH or INFORMIXDIR to your CGI program unless you tell it to do so. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>