I'm using a PHP-based CMS and I want to use LDAP to hook in an active directory (WAMP setup). But LDAP isn't turned on in the default binary for Windows.

I'm in the process of trying to compile it but I'm not optimistic as far as getting every little detail right. Is there no PHP precompiled to work with Active Directory? (I saw the snapshot PHP seems to be but it's not supposed to be for production, right?)

Any advice? Seems like a lot of effort to go through for one teeny command-line switch....:mad:

    If you're on Windows, it's just a matter of enabling the php_ldap.dll extension in your php.ini file.

      bradgrafelman wrote:

      If you're on Windows, it's just a matter of enabling the php_ldap.dll extension in your php.ini file.

      If only. I did that first. So if that's supposed to work, I have another issue/conflict.

      • I uncommented out "extension=php_ldap.dll" in PHP.INI

      • The only other reference to ldap in PHP.INI is:
        [PHP_LDAP]
        extension=php_ldap.dll

      • I ensured that php_ldap.dll is in PHP/ext

      • I put libeay32.dll and ssleay32.dll in the system dierctories.

      But my phpinfo doesn't indicate anything about LDAP at all. MySQL is in there.

      I keep going back to the PHP.NET page where it says: "LDAP support in PHP is not enabled by default. You will need to use the --with-ldap[=DIR] configuration option when compiling PHP to enable LDAP support. DIR is the LDAP base install directory. To enable SASL support, be sure --with-ldap-sasl[=DIR] is used, and that sasl.h exists on the system."

      If that doesn't mean that I have to recompile with that switch, that's great! Less great is having to figure out why I get no recognition from PHP that I'm even trying to work with LDAP.

      Thanks for any further thoughts.

        What version of PHP are you using, and if you make a change in php.ini (say change display_errors from On to Off, or vice versa), does phpinfo() reflect this change? Have you rebooted Apache after making changes to the php.ini file?

        Recompiling really only applies to Unix versions - with Windows, you're just using pre-compiled binaries.

          bradgrafelman wrote:

          What version of PHP are you using,

          5.2.3 and this matches my PHP_LDAP.DLL version.

          bradgrafelman wrote:

          and if you make a change in php.ini (say change display_errors from On to Off, or vice versa), does phpinfo() reflect this change?

          Yes. (If I restart Apache.)

          bradgrafelman wrote:

          Have you rebooted Apache after making changes to the php.ini file?

          Yes. (Or changes don't apply.)

          bradgrafelman wrote:

          Recompiling really only applies to Unix versions - with Windows, you're just using pre-compiled binaries.

          My Apache error log is telling me it can't load the DLL. So that's where I am currently; trying to figure out why. (The path looks good.)

          Thanks for the help guys. Much appreciated.

            Also, it does not appear to be that my extension_dir is pointing to the wrong place. Changing it doesn't help, and the other extensions are loading.

              dsbw wrote:

              And it's a little weird to think that PHP would install itself in "Program Files" if the space in there was going to be a problem.

              I've never relied on the MSI version, and I've never installed PHP in a path w/ spaces.

              Having said that, you might consider installing PHP to a directory without a space (e.g. c:\php).

              Otherwise, try replacing all references of "C:\Program Files\PHP\" with "C:\Progra~1\PHP\" in httpd.conf and php.ini. Also note that you should add the directory PHP is installed in to your system's PATH environment variable (there's a link to the FAQ on this in the stickied thread).

                Well, that killed it completely. Once I moved it I couldn't get it back no matter how often I installed/re-installed.

                  Write a Reply...