The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CPanel with PHP4 and LDAP ???

Discussion in 'General Discussion' started by mcn_doug, Jan 18, 2010.

  1. mcn_doug

    mcn_doug Member

    Joined:
    Jan 18, 2010
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Denver, CO, USA
    I have been trying to configure our Cpanel server that is using php4 to be able to use the php ldap functions to make connections from our application to an LDAP server for authentication, and it doesn't seem to be working.

    When configuring with EasyApache (Easy::Apache v3.2.0 Build 4986), I select apache 2 and php4 (4.4.7 to be precise). I then select all the LDAP options available to me under the Exhaustive Options list, which is LDAP and Auth LDAP. After waiting for the build to finish, I try testing this, I and am getting the following error:
    Fatal error: Call to undefined function: ldap_connect() in <path_here>/test.php on line 9

    When I look at the output file from easyapache I see:
    -- Begin opt 'LDAP' --
    -- Begin step 'to config options' --
    -- End step 'to config options' --

    -- End opt 'LDAP' --
    and then
    -- Begin opt 'Auth LDAP' --
    -- Begin step 'to config options' --
    -- End step 'to config options' --

    -- End opt 'Auth LDAP' --

    but then further down, under 'configuring php for apache and cli' , I see:
    checking for LDAP support... no

    I see the same thing also under 'configuring for system PHP':
    checking for LDAP support... no

    When it is checking for the necessary header files it shows:
    checking for ldap.h... yes

    The system is running CentOS 5.4. Checking for openldap packages shows:
    openldap-2.3.43-3.el5
    openldap-devel-2.3.43-3.el5
    openldap-clients-2.3.43-3.el5

    Do I need to install additional packages before running the build? Are there other options that I need to select with building with EasyApache?

    Any help with this issue would be greatly appreciated.
    --
    Doug
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    You may want to try compiling it manually in the rawopts. Try adding this to /var/cpanel/easy/apache/rawopts/all_php4 and running EA again.

    --with-ldap[=DIR]

    See:

    PHP: Installation - Manual
     
  3. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    What Vanessa detailed is correct; it should suffice to setup the entry as described and then rebuild PHP; specifying the directory is optional and may not be required. To clarify further, the LDAP option for Apache will only affect Apache/httpd; this will not affect PHP.

    To check if the LDAP module is installed with Apache (not PHP), try the following commands via root SSH access:
    Code:
    # /usr/local/apache/bin/httpd -l
    # /usr/local/apache/bin/httpd -M
     
  4. mcn_doug

    mcn_doug Member

    Joined:
    Jan 18, 2010
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Denver, CO, USA
    CPanel and PHP4 with LDAP - Solved

    Vanessa and Don,

    Thank for you very much for your assistance. I was able to get this working this morning.

    Just to leave some notes, in case someone is looking for this (or I need to again):
    In /var/cpanel/easy/apache/rawopts/all_php4, the file all_php4 was not there, so I just created it, with each compile option on a line by itself:
    Code:
    --with-ldap=/usr/
    --with-ldap-sasl=/usr/include/sasl/
    
    The first time I did the compile with EA, I had --with-ldap=/usr/include/ that that gave an error. I found another place that said to leave off the include/, as it is automatically adding the include/ to the directory path that you give.

    --
    Doug
     
Loading...

Share This Page