Heya,

I'm having trouble getting LDAP working properly on my website. I enabled LDAP in the C:\Windows\PHP.ini file. I put the proper dll's in the Windows\System32 folder (and Windows\System just to be safe). I've restarted the IIS service and restarted the server itself, yet I still am getting:

PHP Fatal error: Call to undefined function: ldap_connect() in d:\fltcwww\www\authenticateFunctions.php on line 77

Its not the code, as I've had it working on another web server. I'm running IIS 6, anything extra I have to do to get it to work properly?

Thanks,
Joe

    with the php extensions you dont put them in the system32 folder, there is a special directory, usually in the same one as the php.exe, called extensions. check your php.ini file for the extension_dir setting, and that should tell you where to place the dlls.

      I already checked that, the path for the extensions is correct with the right DLLs in place. I still can't get it to work properly.

      I put the DLLs in all the right folders, commented out the LDAP extension, and it still doesn't work. I've restarted the IIS service and the server itself, it still gives me an undefined function error.

        Anyone have any ideas? I've tried everything and I still get:

        PHP Fatal error: Call to undefined function: ldap_connect() in d:\fltcwww\www\authenticateFunctions.php on line 77

        =(

          The location of the DLL isn't the problem here; if it were you'd get a different error. The error about the "undefined function" is what you'd get if you hadn't enabled the php_ldap extension in php.ini. Are you sure you updated the right one? Check phpinfo() and see if there's an ldap section. Also look at the path that's given for php.ini. After that you can check with the LDAP installation instructions for Windows about which DLLs go where.

            I did indeed enable it in the PHP.ini file (In my Windows folder). I don't, however, get an LDAP section when I do phpinfo(). I've checked and rechecked the .dll location, and I did it just as it instructed.

              And did you take my advice and check phpinfo to see what path it gave for the location of php.ini?

                Yeah, the location of PHP.ini has to be in your PATH environment variable.

                Don't be fooled if you see a path in phpinfo(); as I believe it will throw out the default path even if that file doesn't exist. I could be wrong, but I seemed to have this problem before; phpinfo() looked like it was being configured, but when i made a significant change, like turning register_globals off/on, nothing changed in phpinfo(). If you're positive the path is correct, try doing that; change register_global's setting to the opposite it is currently set at and see if phpinfo() reflects the change.

                  Yeah my path was wrong, thanks a lot for the help guys. Works fine now

                    Write a Reply...