在 Apache PassEnv/SetEnv 中设置 LD_LIBRARY_PATH 仍然找不到库

发布于 2024-08-27 08:39:22 字数 1354 浏览 6 评论 0原文

我正在尝试测试 Cyber​​source 3d party 实施。我能够从命令行让测试文件正常运行,这需要在 Linux 上将支付库的路径导出到 LD_LIBRARY_PATH。

为了尝试在我的服务器上测试这个,我在下面创建了 apache 配置,

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

我使用 SetEnv 命令设置了 env 变量,当我运行打印的页面时,它似乎可以工作,

<?php phpinfo(); ?>

但是通过浏览器调用测试脚本时仍然无法工作,apache 说:

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

所以它找不到链接文件 libspapache.so 即使它位于据称定义的 LD_LIBRARY_PATH 中

我真的很感谢您的帮助。非常感谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

唱一曲作罢 2024-09-03 08:39:22

SetEnv 是每个请求的事情,因此它不会影响 FCGIWrapper 运行的上下文。您想使用 FcgidInitialEnvFcgidCmdOptions 在包装器环境中设置变量。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文