Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting LD_LIBRARY_PATH in Apache PassEnv/SetEnv still cant find library

I am trying to test the Cybersource 3d party implementation. I was able to get the test files running fine from the command line, which requires that on Linux I export the path to the payment libraries to LD_LIBRARY_PATH.

to try to test this on my server I have created the apache config below

<VirtualHost 127.0.0.1:12345>
  AddHandler cgi-script .cgi
  AddHandler fcgid-script .php .fcgi
  FCGIWrapper /my/path/to/php_fcgi/bin/php-cgi .php
  AddType text/html .shtml
  AddOutputFilter INCLUDES .shtml
  DocumentRoot /my/path/to/cybersource/simapi-php-5.0.1/
  ProxyPreserveHost on

  <Directory /my/path/to/cybersource/simapi-php-5.0.1>
    SetEnv LD_LIBRARY_PATH /my/path/to/cybersource/LinkedLibraries/lib/
    AllowOverride all
    Options +Indexes
    IndexOptions Charset=UTF-8
  </Directory>
</VirtualHost>

I have set the env variable there with SetEnv command, which seems to be working when i run a page that prints

<?php phpinfo(); ?>

however the test script when called through the browser still wont work, apache says:

tail /my/apache/error_log 
[Tue Mar 30 23:11:46 2010] [notice] mod_fcgid: call /my/path/to/cybersource/index.php with wrapper /my/path/to/cybersource/php_fcgi/bin/php-cgi
PHP Warning:  PHP Startup: Unable to load dynamic library '/my/path/to/cybersource/extensionsdir/php5_cybersource.so' - libspapache.so: cannot open shared object file: No such file or directory in Unknown on line 0

so it cant find the linked file libspapache.so even though it is in the LD_LIBRARY_PATH that is supposedly defined

i really appreciate the help. thanks so much.

like image 956
JiminyCricket Avatar asked Nov 14 '22 11:11

JiminyCricket


1 Answers

SetEnv is a per-request thing, so it doesn't affect the context that the FCGIWrapper runs under. You want to use FcgidInitialEnv or FcgidCmdOptions to set variables in the environment of the wrapper.

like image 97
hobbs Avatar answered Dec 06 '22 05:12

hobbs