2

I'm at my wits' end on this. I have 2 RH7 boxes that I just installed httpd24 (v2.4.34) on. They were running httpd (v2.4.6) without any connection problems. Now when I try and run Perl scripts from the browser, they fail with...

install_driver(Informix) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Informix/Informix.so' for module DBD::Informix: libifsql.so: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
 at (eval 5) line 3.
Compilation failed in require at (eval 5) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at /var/www/html/app/cgi-bin/test_informix_odbc.cgi line 35.

But when I run the same script from the command line, as 'apache', it runs just fine. All the ENV vars are set correctly.

Anyone run into anything similar before?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
MrCleanX
  • 416
  • 2
  • 13
  • It's only a decade or more since I last did anything with httpd (it would have been 1.3, I think, possibly earlier), but … Getting environment variables set in httpd requires the correct settings in the config file(s), I believe. Do you have the configuration backed up from before the update? Have you looked for differences in the configurations? Do you have [mod_env](https://httpd.apache.org/docs/current/mod/mod_env.html) installed/enabled? Does [How to use the setEnv variable in Apache?](https://stackoverflow.com/questions/3638637/how-to-use-the-setenv-variable-in-apache) help? – Jonathan Leffler Apr 23 '19 at 18:01
  • Done all of that. Set vars in all the usual places, even a few weird ones just to see (/etc/profile, /etc/environment). No luck. Tired both InformixSDK 3.7 ans 4.1. Very frustrating. – MrCleanX Apr 23 '19 at 19:17
  • I don't know whether it is possible for you, but do things start working again if you revert to the old 2.4.6 version of `httpd`? Have you scanned the release notes for version 2.4.7 through 2.4.34 to see if there's anything in there that would be screwing things up? When you run at the command line, you have all sorts of environment stuff (such as a terminal) that may not apply when run in background. Did you move your Informix software? By default, DBD::Informix records the value of INFORMIXDIR when it is built and uses that to locate things. If you move INFORMIXDIR, you may have issues. – Jonathan Leffler Apr 23 '19 at 22:35
  • There is a build-time environment variable for DBD::Informix called DBD_INFORMIX_RELOCATABLE_INFORMIXDIR which is treated as 0/off by default. Maybe looking at that will help. If it used to be able to find `libifsql.so` and can no longer do so, something has changed — the key to resolving your problem is determining what has changed. You may end up having to show which environment variables are set correctly — because there's a fairly good chance that at least one of them is not. Are you using CGI or FastCGI or some other technology for executing the Perl scripts? – Jonathan Leffler Apr 23 '19 at 22:39
  • Did you change the version of Perl? The command-line vs background change of behaviour should be studied hard. Try running the same environment-logging script in the old and new environments to see what's different. – Jonathan Leffler Apr 23 '19 at 22:44
  • Apache may not be passing LD_LIBRARY_PATH to the module. Just for testing purposes, why not set $INFORMIXDIR/lib and $INFORMIXDIR/lib/esql directories in the /etc/ld.so.conf file (or similar)? At least is will tell you if is just an env problem. – jsagrera Apr 24 '19 at 08:32

1 Answers1

0

It would no longer use the LD_LIBRARY_PATH environment variable I was setting in httpd.conf.

Services are started in a fresh environment without any influence of user's environment (like environment variable values). As a consequence, information of all enabled collections will be lost during service start up.

Newer versions of httpd have stopped bringing the user environment in when the service is started. I found this little blurb in /opt/rh/httpd24/service-environment.

grep -r "LD_LIBRARY_PATH" /opt/rh/httpd24/
/opt/rh/httpd24/enable:export LD_LIBRARY_PATH=/opt/rh/httpd24/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

I prepended the standard informix paths in /opt/rh/httpd24/enable.

export LD_LIBRARY_PATH=/opt/IBM/informix/lib:/opt/IBM/informix/lib/esql:/opt/rh/httpd24/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

And everything is back to normal. Woohoo!

MrCleanX
  • 416
  • 2
  • 13