12 Replies Latest reply on Nov 13, 2007 11:43 PM by 390020

    Problems with libclntsh.so.10.1 and PHP/Apache HTTPD

    451188
      Hello,

      I've been wrestling with the install of Instant Client/OCI8 with PHP 5.0.4 and Apache HTTPD 2.0.52 on RHEL4 ES. Most recently I've followed the instructions detailed here: http://www.oracle.com/technology/pub/notes/technote_php_instant.html

      Apache is installed from the RHN rpm.

      PHP was successfully compiled with the following parameters:
      ./configure with-mysql with-ssl with-ldap with-apxs2 with-dom with-oci8-instant-client=/usr/local/oracle/instantclient_10_2 --enable-sigchild

      I've also attempted to get OCI8 working using the full Administration Client from CD. In either case, I can compile/install PHP just fine. I've indexed the Instant Client directory with ldconfig, and the user that runs HTTPD has read/execute permissions on libclntsh.so.10.1 and on all the directories above it. Nonetheless, when I start Apache, I invariably run into the following error:

      # /etc/init.d/httpd start
      Starting httpd: Syntax error on line 190 of /etc/httpd/conf/httpd.conf:
      Cannot load /usr/lib/httpd/modules/libphp5.so into server: libclntsh.so.10.1: failed to map segment from shared object: Permission denied [FAILED]


      Thanks in advance for any insight,
      Patrick

      Message was edited by:
      dog.breath
        • 1. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
          438342
          If your SELinux is turned on - try turning it off and restarting apache.

          Check /etc/selinux/config to know if SELinux is enabled
          • 2. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
            5163
            I have a similar problem:

            Syntax error on line 202 of /etc/httpd/conf/httpd.conf:
            Cannot load /usr/lib/httpd/modules/libphp5.so into server: libclntsh.so.10.1: cannot open shared object file: No such file or directory

            Using the following succesfull configuraion
            PHP Version => 5.0.4
            System => Linux 2.6.9-1.667smp #1 SMP Tue Nov 2 14:59:52 EST 2004 i686
            Build Date => Aug 26 2005 11:23:17
            Configure Command => './configure' '--enable-force-cgi-redirect' '--enable-ftp' '--with-dbase' '--with-regex=system' '--with-gd' '--with-bz2' '--with-config-file-path=/etc/httpd/conf/httpd.conf' '--with-zlib' '--with-oci8=/home/oracle/product/10.1.0/Db_1' '--enable-sigchild' '--with-dom-xslt=/usr/lib/libxslt.so.1.1.11' '--with-png' '--with-apxs2'
            Server API => Command Line Interface
            Virtual Directory Support => disabled
            Configuration File (php.ini) Path => /etc/httpd/conf/httpd.conf

            Everything is visible to all users the LD Library path is set even in the httpd.conf file.
            Clear PHP works from within the command line, now I want to get it working via Apache2.
            If anybody has a clue I would be most obliged.
            Also disabling SELinux did not do the trick.
            • 3. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
              438342
              Your problem is not same as the OP's. In your case the run time linker/loader can't find libclntsh.so - this has nothing to do with SELinux

              I have a question - you have built php as '--with-config-path=/etc/httpd/conf/httpd.conf'. I thought --with-config-path is the location of php.ini not the httpd.conf

              How are you setting the LD_LIBRARY_PATH ? Either do a SetEnv or a PassEnv in the httpd.conf.
              • 4. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
                Ivan Kartik
                How are you setting the LD_LIBRARY_PATH ? Either do a SetEnv or a PassEnv in the httpd.conf.
                Or set the LD_LIBRARY_PATH in apachectl file directly.
                • 5. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
                  438342
                  How are you setting the LD_LIBRARY_PATH ? Either do a SetEnv or a PassEnv in the >> httpd.conf.
                  Sorry, this is so fubar of me :). Setting an ENV via SetEnv and PassEnv only sets/passes that Env into Apache children. You will need to set then ENV is apachectl (like Ivan.Kartik mentioned) or in the shell /program that you are launching apache from.
                  • 6. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
                    cj
                    Sounds like http://www.oracle.com/technology/tech/php/htdocs/php_troubleshooting_faq.html#envvars

                    -- CJ
                    • 7. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
                      451188
                      Thanks, Saju!

                      Disabling selinux for httpd allowed the daemon to run. Now on to learn more about selinux and see if it can be configured to allow the Oracle libraries...

                      dog.breath
                      • 8. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
                        451188
                        alfreddj,

                        I was having this problem initially. I found using ldconfig to be a better solution than adding ENV vars to scripts or even to setting LD_LIBRARY_PATH (in fact, neither of those things worked). What did work was adding the Oracle libs via ldconfig & /etc/ld.so.conf :

                        % [sudo] ldconfig /path/to/oracle/lib

                        If I understand correctly, this will add /path/to/oracle/lib to your /etc/ld.so.conf file, but you may want to verify that its really there and possibly add it manually.

                        - dog.breath
                        • 9. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
                          439053
                          Saju,

                          I have similar issue on Linux 9 (Shrike)

                          bash $sqlplus
                          sqlplus: relocation error: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/b
                          in/../lib/libclntsh.so.10.1: symbol semtimedop, version GLIBC_2.3.3 not defined
                          in file libc.so.6 with link time reference

                          please let me know if you know anything about this error!!

                          I get same error when I try to start server or listener and it doesn't get started..
                          • 10. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
                            591425
                            Are there any new developments on getting Instant Client to work with SELinux enabled? What I found is that if I change SELinux policy by add the following:

                            allow httpd_t self:process execstack;

                            Then it works. Now making process stack executable is a very bad idea and can lead to buffer overflow. If anyone out there managed to get this to work without allowing executable stack, then I would like to know. Please email(ukhanlists AT hotmail.com) me and let me know. Thanks
                            • 11. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
                              cj
                              Good question, but wrong forum. Try asking in the Instant Client forum Instant Client

                              -- cj
                              • 12. Re: Problems with libclntsh.so.10.1 and PHP/Apache HTTPD
                                390020
                                Well, this problem applies to other versions of clients too. I'm using the 10g 64 bits client for Linux in RH and I get the same error while trying to start apache 2, however, I'm able to compile and use php with apache 1.3 in the same machine with the same client.

                                I tried the suggested solutions without luck (although I should put a little more effort in the SELinux path) ¡Viva AppArmor!