4

I've looked at many of the previous questions, but I'm still unable to get this issue fixed. I've installed PHP Version 5.4.9 and Apache 2.4.12 in windows - 64Bit. When I start the service I get the following error :

PHP Warning:  PHP Startup: Unable to load dynamic library 'D:\app\php\ext\php_ldap.dll' - The specified module could not be found in Unknown on line 0.

The path where PHP is : D:\app\php

My extension path in php.ini is : extension_dir = D:\app\php\ext

Path where libeay32.dll and ssleay32.dll is : D:\app\php

I referred to the Questions posted in the link below :

Link 1

Link 2

Link 3

yet nothing seems to work. Appreciate any help.

2
  • I did a quick search with these keywords: php could not be found in Unknown and found this SO question, please check if one of the answers solves your problem. Commented Apr 11, 2016 at 12:14
  • @AlexShesterov Thanks for the quick response. The dll file the question is for is php_intl.dll but I am specifically looking for php_ldap.dll. Everything else is working except this.
    – SR1092
    Commented Apr 11, 2016 at 12:17

6 Answers 6

3

after enabling extension =php_ldap.dll in php.ini

you must add following dll to system32 in windows

copy libsasl.dll into system32 folder

steps: php.ini enable ;extension =php_ldap.dll --> extension =php_ldap.dll

copy libsasl.dll from php folder and paste it in system32

windows-->system32--> paste libsasl.dll

Incase it does not work and also add libeay32.dll and ssleay32.dll.

1

Try copying libeay32.dll,ssleay32.dll and libeay32.dll in sysWow64 and Restart the machine. It should work.

0
0

with Win10, Apache 2.4.41x64 and php 7.3.8x64 the following worked for me: overwrite these dlls in Apache/bin folder with the files from php folder

  • libssl-1_1-x64.dll
  • libcrypto-1_1-x64.dll

also added libsasl.dll
Do not need to change any system folder content.
Of course the the right php.ini settings are crucial (enable extension, set extension path).
Then restart Apache.

0

For Windows 10 copy a file from 'xampp\php\libsasl.dll' and paste it into 'xampp\apache\bin' After this restart Apache server once.

0

I just came across this article because I had the same issue on Windows. PHP told me that "The specified module could not be found". I didn't want to put files into the system folders so I added the php directory to the windows path environment variable. In my opinion this is less 'invasive' and it's the recommended way according to https://www.php.net/manual/en/ldap.installation.php

This worked for me. Cheers.

0

There is an alternate way to enable LDAP with Apache, by loading the appropriate DLL files with Apache.

This means no file-copying/replacing files anywhere and is probably the safest least invasive way to enable PHP extensions that need DLL's.

In the apache24/conf/httpd.conf file add the following before the LoadModule php_module "<pathToPhp>/php8apache2_4.dll"

# Load DLL files (SSL CURL and other supports for PHP as Module under Apache)
LoadFile "<pathToPhp>/libeay32.dll"
LoadFile "<pathToPhp>/ssleay32.dll"
LoadFile "<pathToPhp>/libsasl.dll"

# Load PHP as module under Apache
LoadModule php_module "<pathToPhp>/php8apache2_4.dll"

My system is running Windows 11, Apache 2.4, PHP 8.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.