Search code examples
apacheperlodbcinformix

Redhat with httpd24 connecting to Informix using DBI


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?


Solution

  • 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!