[Date Prev][Date Next] [Chronological] [Thread] [Top]

Using PHP with LDAP

I'm having trouble using LDAP functionality within PHP. Running the PHP script from the command line works just fine, using the Apache user. However accessing the PHP script through HTTP does not give the same result.
I've narrowed down the problem to a certificate issue, in fact it is a self signed certificate so I've changed the ldap.conf file setting TLS_REQCERT to 'allow'. Also changing the permissions to make it readable for the Apache user. Those settings were necessary to run the script from the command line. However this does not seem sufficient to succesfully run the script from HTTP.

Also the .ldaprc file seems to be ignored. I've tried to place this file in the home dir of the Apache user with the setting mentioned above but no changes were visible when running the PHP script.

To be more precise about the PHP script: it tries to connect to the LDAP server using v3 with ldaps.

Apache does not seem to be run chrooted. LDAPsearch works just fine (in fact testing with ldapsearch in verbose mode pointed out the certificate problem which was solved with the TLS_REQCERT setting).

Any ideas on how to solve this problem are welcome.

Name: Thomas Berton (ICT&O)
Email: thomas.berton@ugent.be
URL: http://icto.ugent.be