Re: Running dynamically linked CGIs?
From: Tim X (timx_at_spamto.devnul.com)
Date: 07 Jul 2003 18:30:21 +1000
>>>>> "Ramon" == Ramon F Herrera <firstname.lastname@example.org> writes:
Ramon> I am going to answer part of my own posting.
Ramon> email@example.com (Ramon F Herrera) wrote in message
>> It seems that the Apache server doesn't have access to the Oracle
>> libraries. I tried linking the application statically, but that
>> doesn't seem to be an option (?) with OCI. Next, I looked at the
>> httpd config file and copied the library in question
>> (libclntsh.so.9.0) to the directory /etc/httpd/modules/. (Am I in
>> the right direction?) The problem now is that I am not sure about
>> what the entry should look like. There is an example:
>> # Example: # LoadModule foo_module modules/mod_foo.so
>> So I figure that the entry should be something like this:
>> LoadModule what_the_heck_goes_here modules/libclntsh.so.9.0
Ramon> The LoadModule has _nothing_ to do with this, dummy :-)
Ramon> Those modules are linked to the Apache server itself, and not
Ramon> to the cgi-bin or other apps that may be exec'd by Apache.
Ramon> The error message above was fixed simply by adding
Ramon> To the /etc/ld.so.conf file and redoing the .so cache.
Ramon> Having said that, I am not out of the woods yet. The new
Ramon> error message says:
Ramon> nclaims: FAILED: OCIInitialize() nclaims: FAILED:
Ramon> init_handles() nclaims: There was an error on 'OCILogon' [Thu
Ramon> Jul 3 03:39:02 2003] [error] [client x.x.x.x] Premature end of
Ramon> script headers: /home/ramon/public_html/cgi-bin/claimsof.cgi
Ramon> (the same programs runs flawlessly from the Unix shell).
Ramon> Now it looks like the OCI .so library is being found at link
Ramon> time, but not at execute time??
When running your OCI cgi program from the unix shell are you using
the same user that apache is running as? e.g. nobody?
It could be that when you are testing it, you have a properly defined
oracle environment (ORACLE_HOME, ORACLE_SID etc), but not when the cgi
script is running under the user who runs apache or the user who is
running apache does not have access to directories needed etc.
-- Tim Cross The e-mail address on this message is FALSE (obviously!). My real e-mail is to a company in Australia called rapttech and my login is tcross - if you really need to send mail, you should be able to work it out!