Configure LDAP certificate dir in PHP 5.5.x (Windows)

1.5k views Asked by At

Until version 5.4, when PHP was compiled from its source, LDAP extension was hard coded to look for its certificates in c:\openldap\sysconf folder. Since 5.5, this 'harcode' was replace by an environment variable called %SYSCONFDIR%. However i can't make LDAP extension point to the same dir it did before, no matter what i do! :(

In PHP 5.4, ldap_config.h

#define LDAP_SYSCONFDIR "c:\\openldap\\sysconf"

In PHP 5.5, ldap_config.h

#define LDAP_SYSCONFDIR "%SYSCONFDIR%"

Sorry for my bad english. Any clue? Thanks.

3

There are 3 answers

0
Mark On BEST ANSWER

Download the latest version of PHP 5.5.

This has been resolved in the PHP 5.5.4 binaries from windows.php.net. The LDAP extension looks for "c:\openldap\sysconf\ldap.conf" as it had done in 5.4.

2
Vlad On

I ran a trace with Sysinternals Process Explorer and it revealed that php_ldap was attempting to open the file C:\Apache24\%SYSCONFDIR%\ldap.conf, where %SYSCONFDIR% is interpreted literally and not expanded from the contents of an environment variable. I have Apache installed in C:\Apache24, but obviously the exact path will vary depending on the name of your Apache folder. In the root folder of your Apache installation, create a folder named %SYSCONFDIR% (literally!) and put ldap.conf in there. That solved it for me.

0
vbsessa On

It seems that it will be fixed by php team in the next release. See https://bugs.php.net/bug.php?id=65642