solegaonkar has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, Anyone seen this issue.. I have a script that connects to SQLServer. It works in standalone.. but in CGI, gives error libmsodbcsql-11.0.so not found.. Tried updating the LD_LIBRARY_PATH. Set the permissions on the library file as well as the entire path to 777. But no luck... Can you please suggest what could be wrong!

Replies are listed 'Best First'.
Re: CGI Script connection to SQL Server.
by marto (Cardinal) on May 27, 2015 at 09:46 UTC

    If it's running switch off SELinux and test again from the browser.

      Finally found the solution to this. Not sure why, but it works. I had set all the environment variables at the begining of the cgi script. Moved it to apache conf file and it worked all well!
      No, it is not running SELinux.. % ps -eaf | grep -i SELinux octane 7341 6664 0 05:52 pts/0 00:00:00 grep -i selinux
Re: CGI Script connection to SQL Server.
by afoken (Chancellor) on May 28, 2015 at 10:43 UTC

    Compare environment printout from running standalone with environment printout from running as CGI. Most likely some variables are missing, or some directory is missing from $ENV{PATH}.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: CGI Script connection to SQL Server.
by Anonymous Monk on May 27, 2015 at 09:58 UTC

    Tried updating the LD_LIBRARY_PATH.

    But did you do it in time?

Re: CGI Script connection to SQL Server.
by Anonymous Monk on May 28, 2015 at 10:48 UTC

    Tried updating the LD_LIBRARY_PATH.

    How did you try to update LD_LIBRARY_PATH (be specific)?