Object interface for c++ and apache
Posted in 1999
Topics: General Discussion
Has anyone used the object interface for c++ through apache web server as a cgi applicaion. I am able to execute my database query just fine from the command line, but when I execute it as a cgi the libraries don't load and everything fails. Does anyone have any information about this.
Your cgi application cannot find library. I suggest you to write a shell program to set up your library's path and other necessary environment, then do a system call (exec) of your program. That should work. Good luck! Greg Tibbitts wrote: > Has anyone used the object interface for c++ through apache web server > as a cgi applicaion. I am able to execute my database query just fine > from the command line, but when I execute it as a cgi the libraries > don't load and everything fails. Does anyone have any information about > this.
Greg Tibbitts wrote: > Has anyone used the object interface for c++ through apache web server > as a cgi applicaion. I am able to execute my database query just fine > from the command line, but when I execute it as a cgi the libraries > don't load and everything fails. Does anyone have any information > about this. You asked about the plain C++ object interface, and also about the C++ object interface under Apache. I'm only asnwering one of the two questions, but the info here may cover your other one too. When there's a problem with Informix software running under Apache, the problem is very often environment. Specifically, do you know what the environment is in your CGI executables? Does it include any of the Informix environment variables. Unless you tell Apache to set them (SetEnv or PassEnv directives), they will not be present in the environment of your CGI binary, and therefore your programs will fail. You must set INFORMIXSERVER. You probably need to set INFORMIXDIR. You may need to set or augment LD_LIBRARY_PATH. You may need to set other environment variables too (locale, etc). The other problem you can run foul of with C++ is using the wrong C++ compiler. Specifically, the GNU C++ compilers won't work unless you get a C++ library that was built to work with them. The C++ object layouts and exception handling is different between SUNWspro and G++, and to protect itself, G++ uses a different, non-standard name mangling scheme. Things won't link unless you use the SUNWspro compiler (the other question was specifically about Solaris 2.6, just in case you're wondering why I'm talking so specifically about SUNWspro, but the principle applies to other o/s as well). Unless, of course, G++ is the native compiler, as on Linux. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>