PHP how to specify ldap.conf location?

I have PHP compiled with ldap support and it works as expected. Now I need to do some configuration for SSL / TLS, but I do not have the ldap.conf file.

php -i says it was compiled with --with-ldap = / usr, so I have to make the ldap.conf file in / usr, but I don’t have write permission due to the architectural limitation of the device.

How can I specify the path to ldap.conf for php? Is there a php.ini setting? Maybe a parameter on the command line?

+4
source share
2 answers

See http://de3.php.net/manual/en/function.ldap-connect.php#36156 :

You also need to put the same settings into a file inside an Apache Web homedir user called .ldaprc e.g.: cp / usr / local / openldap / etc / openldap / ldap.conf ~ www / .ldaprc)

The key here is the root directory of the Apache web server, as well as .ldaprc .

Also see the official ldap man pages:

Users can create an additional configuration file, ldaprc or .ldaprc, in their home directory, which will be used to override the system-wide default file. The ldaprc file in the current working directory is also b.

+2
source

In XAMPP on Windows, the ldap.conf file must be either in the root of the system (c: \ ldap.conf, PHP 5.3.3, if I remember correctly), or in C: \ openldap \ sysconf \ depending on the PHP version. It seems that the path is not configurable because it is hardcoded in the Windows PHP DLL. See Comments http://se2.php.net/manual/en/ref.ldap.php

+3
source

All Articles