Hi everyone. I've been stuck on this problem for a while, and it's driving me nuts, so I'd greatly appreciate the help!

I have PHP set up on a Microsoft IIS 5.x server. For authentication purposes, I am trying to query a Microsoft Exchange of user information via LDAP. Now, I have never used LDAP before, but I followed the instructions very closely. Here is what I've done so far:

  • Placed php_ldap.dll and libsasl.dll in the c:/php/extensions folder
  • Uncommented the extension for php_ldap.dll in the php.ini file and set the extension_dir to c:/php/estensions
  • Gave the IUSR_machine_name full privileges to the php_ldap.dll and libsasl.dll files, as well as the folders they reside in.
  • I have tried placing the .dll's in the c:/winnt/system32 directory, and still the same problem. I have also downloaded all the .dll's in the windows binary version of the PHP download and placed them all in the system32 directory.

The problem I'm having is that whenever I try to access the website I get a pop-up message on the server that states:
"Unknown(): Unable to load dynamic library 'c:/php/extensions/php_ldap.dll' - Access is denied". This occurs whenever I try to access any of the PHP pages, not just the one that tries to connect to the Exchange Server via LDAP. One more possible clue is that my phpInfo() page doesn't mention anything about LDAP being used in the system.

My hunch is that this is a permissions thing, but I've tried everything I know to do as far as that goes! Anybody out there ever had this problem or have any ideas? I'd be very grateful.

Thanks,
Brian Hibma
bhibma23@calvin.edu

    4 months later

    I'm having the same problem, has anyone ever seen this before?

    Config is as follows:
    w2k server
    IIS5
    PHP 4.3.2

    It's driving me insane!

      Try to copy libeay32.dll and ssleay32.dll
      instead of libsasl.dll

      it worked for me

        I took the entire contents of php 4.3.2 \ dll and copied to c:\winnt\system32. Still no luck. I've given IUSR_{Computer Name} full control of the extensions folder. I'm starting to wonder if this is even a compatible configuration.

          It is for sure a compatible configuration...
          I have it runing on both Win2K server and WinXP pro.
          (same IIS and php version)

          It should be sufficient to copy the php_ldap.dll, libeay32.dll and ssleay32.dll
          to the \system32 folder.

          I newer had to change any file permissons...

          I installed php in c:\php4\ since PEAR have (had?) a bug on windows that prevented installation to any other directory.

          Try typing php.exe -? and check for any messages

            I've seen that from many people (that you don't have to change file permissions) I ran php.exe -? and simply got help commands. PHP is installed in c:\php The PHP.ini file looks like

            ; Directory in which the loadable extensions (modules) reside.
            extension_dir = c:\php\extensions

            extension=php_ldap.dll

            I've tried to move the slashes around, with and without quotes, etc. If I rename the extension dir to something that doesn't exist it gives me

            "The specified module cannot be found" which leads me to believe that I have the correct configuration for the extension_dir line. Do I have to register any of these DLLs?

              5 years later

              I've got the same problem. So far I've found solutions such as editing the Path but what I don't understand is that if my other dll's and functions work why not LDAP.

              My Apache logs say that it can't load php_ldap.dll

              The operating system cannot run %1.\r\n in Unknown on line 0

              But when I run the pages form command line they do work and php.exe is using all the same PATH variables that the apache module is using...

              I checked the apache conf file and there's nothing in there to lead me to believe that Apache can't find my ext directories...

                19 days later

                Ok I solved my error... turns out apache was loading a different module that uses the same ssl libraries...

                To fix this I had to create a second apache process independant of the first.

                  Write a Reply...