如何摆脱ldap_connect()错误

  • Windows Server 2016 64 bit (Fully Updated)
  • WAMP/3.0.6 (Win32)
  • Apache/2.4.9 (Win32)

  • PHP/7.2.6 (Win32)

Error 1 : Fatal error: Uncaught Error: Call to undefined function ldap_connect()

I've been sitting with this error now for a while and I don't seem to get it sorted. Nothing I do seems to have any impact on this error. I also can't seem to find any source of these DLL files. My guess is that the DLL fails to load , because it's somehow not compatible with 7.2.6

What I have tried :

0.) Enabled extension in php.ini using the correct php.ini file

1.) Copied libeay32.dll,ssleay32.dll,php_ldap.dll,libsasl.dll into C:\Windows\system, \apache2.4.9\bin

Everything else works fine. I can run phpinfo() and I have a few other sites on there that open up fine. My error log file is as follows :

[16-Jun-2018 20:17:30 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_curl.dll' (tried: d:/wamp/bin/php/php7.2.6/ext/php_curl.dll (The specified module could not be found.), d:/wamp/bin/php/php7.2.6/ext/php_php_curl.dll.dll (The specified module could not be found.)) in Unknown on line 0
[16-Jun-2018 20:17:30 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_ldap.dll' (tried: d:/wamp/bin/php/php7.2.6/ext/php_ldap.dll (The specified module could not be found.), d:/wamp/bin/php/php7.2.6/ext/php_php_ldap.dll.dll (The specified module could not be found.)) in Unknown on line 0
[16-Jun-2018 20:17:30 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_openssl.dll' (tried: d:/wamp/bin/php/php7.2.6/ext/php_openssl.dll (The specified module could not be found.), d:/wamp/bin/php/php7.2.6/ext/php_php_openssl.dll.dll (The specified module could not be found.)) in Unknown on line 0
[16-Jun-2018 20:17:30 UTC] PHP Deprecated:  Directive 'track_errors' is deprecated in Unknown on line 0

How can I get rid of the ldap error ?

I ended up downloading and installing a new version of WAMP which included PHP 7.2.4. I then enabled the extension=php_ldap.dll. I did not need to copy any other files