I cannot seem to get ldap to work with php on NT4. I found a php_ldap.dll file on the net. I copied it to c:\php\extensions. I edited my c:\winnt\php.ini file and uncommented the ldap extension line. I set extension_dir to 'c:\php\extensions\'. I have stopped and started the webserver. I try a sample page and get this error:

Warning: Unable to load dynamic library 'c:\php\extensions\php_ldap.dll' - The specified procedure could not be found. in C:\Webs\McKinley\secdb\scripts\showuser.php on line 29

The file c:\php\extensions\php_ldap.dll is there! Why is it unable to load it? Does anyone have a howto on how to get php and ldap on NT to work? Do I need to compile this whole thing from scratch with the iPlanet ldapsdk 5.0?

Thanks,
Charles
charles_leeds@mckee.com

    This seems to be a generic error that anybody who tries to uncomment a dll in the php.ini file gets (including me)

    I wish there were SOME resource available online that told us what the hell we had to do to get this thing to work properly.

    In my case, I'm trying to load the php_interbase.dll file and getting the exact same error. I've been toying around (like hell) with the extension_dir parameter and getting the same damn error.

    -Surojit

      dont' bother with the extensions directory. I got this working by copying php4ts.dll and php_ldap.dll into c:\winnt\system32. My extensions directory configuration (php.ini) is just set to the default I think -
      extension_dir = ./
      '
      The ldap stuff works great.

      RW

      ===========================================
      http://badblue.com
      Free small footprint web server for Windows

      P2P file-sharing, PHP, wireless apps & more

        what is the php4ts.dll file for anyway? shouldn't it work fine sitting in the c:/PHP (default) directory?

        -Surojit

          Does it matter if you installed php as a cgi or an isapi install? I have changed the extensions directory back to ./ and copied the dll's to winnt\system32 and still get:

          Fatal error: Call to undefined function: ldap_connect() in C:\Webs\McKinley\secdb\scripts\showuser.php on line 30
          PHP Warning: Unable to load dynamic library './php_ldap.dll' - The specified procedure could not be found. in Unknown on line 0

          Thanks a bunch,
          Charles

            Okay, I'm making progress. I changed the ./ to a more Windows friendly .\ and now I just get:

            Fatal error: Call to undefined function: ldap_connect() in C:\Webs\McKinley\secdb\scripts\showuser.php on line 30

            indicating it is at least loading the dll now. Randy did you have to install some kind of ldap software development kit, or only the php_ldap.dll?

            Thanks,
            Charles

              Oh, wait a minute, the dll problem went away because I commented back out the php_ldap extension. Uncommenting it brings me the same errors again, so the ./ to .\ did nothing.

              Charles

                Try copying libsasl.dll into c:\winnt\system32 - I think I needed to do that.

                Dave

                  Dave,

                  Where did you get your php_ldap.dll?

                  I copied the libsasl.dll into c:\winnt\system32 and c:\php and it makes no difference. I still get:

                  PHP Warning: Unable to load dynamic library '.\php_ldap.dll' - The specified procedure could not be found. in Unknown on line 0

                  any time I uncomment the php_ldap extension.

                  Thanks for the tip though. I'm desperate to make this work.

                  Thanks,
                  Charles

                    I got it to work finally! Using the php_ldap.dll from the PHPTriad project which is 100k instead of the 68k one I found somewhere on the net, everything now works!

                    Thanks a bunch to everyone.

                    Charles
                    lds0062@cdc.net

                      What about the extension_dir problem? How did you get that problem to go away? Any help would greatly be appreciated. thanks!

                      -S

                        My extension_dir is set to .\ and I put my dll's under c:\php and c:\winnt\system32, though c:\php is where it is loading them from.

                        extension_dir = .\

                        If you have a bad dll though, it may give you the same error as when it can't find the dll. So install phptriad and get your dll from the phptriad install and then try again.

                        Charles

                          7 months later

                          For me it worked, when i copied the needed libsasl.dll to the win\system32 dir. That's all.

                          CU,
                          dustpuppy

                            a month later

                            Easy but like everyone else had a @!#$ of a time finding the answer. Only supports short name spaces for the extension directory so throw this in the old php.ini and away you go.

                            extension_dir = c:\Php\extens~1

                              Write a Reply...