Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jan 2010
    Location
    Denver, CO, USA
    Posts
    8

    Default CPanel with PHP4 and LDAP ???

    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. #2
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Sep 2006
    Location
    Virginia Beach, VA
    Posts
    254
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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. #3
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by vanessa View Post
    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
    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. #4
    Member
    Join Date
    Jan 2010
    Location
    Denver, CO, USA
    Posts
    8

    Default 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

Similar Threads & Tags
Similar threads

  1. cPanel LDAP authorisation
    By igluksic in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 07-07-2009, 09:56 AM
  2. ldap and cPanel
    By bisdiouf in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-25-2006, 12:19 PM
  3. ldap and cPanel
    By bisdiouf in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-25-2006, 12:14 PM
  4. CPanel + LDAP Auth
    By spd1snd in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-05-2006, 12:43 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube