带有 httpd24 的 Redhat 使用 DBI 连接到 Informix

Redhat with httpd24 connecting to Informix using DBI

我对此束手无策。我有 2 个 RH7 盒子,我刚刚在上面安装了 httpd24 (v2.4.34)。他们 运行ning httpd (v2.4.6) 没有任何连接问题。现在,当我尝试 运行 来自浏览器的 Perl 脚本时,它们失败了...

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.

但是当我从命令行 运行 使用与 'apache' 相同的脚本时,它 运行 就好了。所有 ENV 变量都已正确设置。

有人 运行 以前做过类似的事情吗?

它将不再使用我在 httpd.conf 中设置的 LD_LIBRARY_PATH 环境变量。

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.

较新版本的 httpd 已停止在服务启动时引入用户环境。我在 /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}}

我在 /opt/rh/httpd24/enable 中添加了标准的 informix 路径。

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}}

一切都恢复正常了。哇哦!