1

I am trying to set my environment variables for the Apache webserver as it is not the correct Perl package. I followed the recommendation of one of the answers on Server Fault for updating the httpd file and adding the environment variables and it still isn't working. After I updated the httpd file I bounced the httpd process as well. On the command line the correct PATH is being used for Perl. Can anyone offer any guidance?

Error in apache error.log file:

[pid 29460] [client 10.199.106.141:57768] AH01215: install_driver(Informix) failed: Can't locate DBD/Informix.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 7)

The correct location of Perl where Apache should check for Perl Modules

/usr/bin/perl

Updated /etc/sysconfig/httpd file

#Configuration of variables for webserver

export INFORMIXDIR=/opt/informix

export    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFORMIXDIR/lib:$INFORMIXDIR/lib/cli:$INFORMIXDIR/lib/esql:$INFORMIXDIR/lib/tools

export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts

PATH=$PATH:$HOME/bin:$INFORMIXDIR/bin:$LD_LIBRARY_PATH

export PATH

Other environment variables

OS Package:  Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.4.16
CONTEXT_DOCUMENT_ROOT = /var/www/cgi-bin/
BV45
  • 111
  • 3
  • You might take a peek at [this post](http://serverfault.com/questions/295660/set-environment-variable-for-process-spawned-by-apache-webserver?rq=1) also look for a file under /etc/httpd called env or envenv that may be overriding LD_LIBRARY_PATH and of course, depending on your CGI scripts, you may have to define paths in the scripts themselves depending on taint settings. – Aaron Sep 08 '15 at 19:15
  • Thanks. Ok I don't have that file under /etc/httpd. I'll see if our SA might know? That link wasn't too clear for me. Okay I'll work on setting the environment variables in the CGI script then. Was thinking it was just something we could set just like in the bash profile for all users. – BV45 Sep 08 '15 at 19:44
  • I've added the use lib '/home/path' and it still isn't working. Any other ideas? – BV45 Sep 09 '15 at 18:37
  • At this point I would be guessing and poking around in the dark. Your sysadmin should open a case with the vendor and find out what debug logs or configs they will need. – Aaron Sep 09 '15 at 22:36

1 Answers1

0

Your error

Can't locate DBD/Informix.pm in @INC

means that it is missing the Perl module DBD::Informix. There are a variety of options for getting this module:

  1. on Red Hat, or systems: yum install perl-DBD-Informix
  2. on Debian or Ubuntu: apt-get install libdbd-informix-perl
  3. using cpanminus to create a local library: cpanm DBD::Informix
  4. using CPAN.pm

If you've been installing things from your distribution generally it is good to continue to do that, but otherwise one of the more Perl-specific methods (cpanminus or CPAN.pm) will probably give you something that works.

chicks
  • 3,793
  • 10
  • 27
  • 36