Results 1 to 4 of 4

Thread: LD_LIBRARY_PATH problem with Apache

  1. #1
    Join Date
    Jun 2007
    Location
    Quebec, Canada
    Beans
    55
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question LD_LIBRARY_PATH problem with Apache

    Hi guys.

    I compiled a PHP module named sapnwrfc, and this module needs the environment variable LD_LIBRARY_PATH to be set to:

    Code:
    LD_LIBRARY_PATH=/usr/sap/nwrfcsdk/lib/
    So I tried editing the .bashrc file in my home directory adding the following at the end (then loging out and loging in):

    Code:
    LD_LIBRARY_PATH=/usr/sap/nwrfcsdk/lib/
    export LD_LIBRARY_PATH
    When I type "env" in a bash shell, the variable is set. But whenever I try running my PHP script from Firefox, I get a missing files error message in Apache's error.log, ending with:

    Code:
    LD_LIBRARY_PATH is currently set to <not set>
    My guess is that I should not set the variable in .bashrc, but somewhere else. I just don't know where.

    Thanks a lot for your help, as always.

  2. #2
    Join Date
    Jun 2007
    Location
    Quebec, Canada
    Beans
    55
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: LD_LIBRARY_PATH problem with Apache

    Ok... Still working on this problem, I added the following in my PHP script:

    Code:
    putenv("LD_LIBRARY_PATH=/usr/sap/nwrfcsdk/")
    And also chmodded all required library files to 755. Now I the error message I get is:

    The following files must be in the path described by
    the environment variable "LD_LIBRARY_PATH":
    libicuuc.so.34, libicudata.so.34, libicui18n.so.34 [nlsui0_mt.c 1529] pid = 28958
    LD_LIBRARY_PATH is currently set to /usr/sap/nwrfcsdk/lib/
    And I really don't get it because this path leads directly to the required libraries...

    Any clues?

  3. #3
    Join Date
    Jun 2007
    Location
    Quebec, Canada
    Beans
    55
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: LD_LIBRARY_PATH problem with Apache

    I just tried

    Code:
    ldd sapnwrfc.so
    and got this for output:

    Code:
    	linux-vdso.so.1 =>  (0x00007fffd3fff000)
    	libsapucum.so => /usr/sap/nwrfcsdk/lib/libsapucum.so (0x00007f8651d99000)
    	libsapnwrfc.so => /usr/sap/nwrfcsdk/lib/libsapnwrfc.so (0x00007f865169b000)
    	libc.so.6 => /lib/libc.so.6 (0x00007f86512fd000)
    	libdl.so.2 => /lib/libdl.so.2 (0x00007f86510f9000)
    	librt.so.1 => /lib/librt.so.1 (0x00007f8650ef1000)
    	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f8650bdc000)
    	libm.so.6 => /lib/libm.so.6 (0x00007f8650959000)
    	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f8650742000)
    	libpthread.so.0 => /lib/libpthread.so.0 (0x00007f8650524000)
    	/lib64/ld-linux-x86-64.so.2 (0x00007f8652133000)
    ...so none of these libs cause the problem. But now that I look into this, shouldn't libicuuc.so.34, libicudata.so.34, and libicui18n.so.34 be in this list?

    Thanks for any idea you might have.

  4. #4
    Join Date
    Jun 2007
    Location
    Quebec, Canada
    Beans
    55
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: LD_LIBRARY_PATH problem with Apache

    Hoping this might help someone someday, here's how I fixed the problem with the precious help of Pierce Harding, the module's author.

    I created a file:

    Code:
    /etc/ld.so.conf.d/sapnwrfc.conf
    containing this one and only line:

    Code:
    /usr/sap/nwrfcsdk/lib
    Then:

    Code:
    sudo ldconfig
    sudo /etc/init.d/apache2 restart
    Now it works like a charm.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •