2

I have Apache 2.4 and php installed on Windows Server 2012.

Im trying to load the php_ldap.dll extension.

Here's what Ive done:

In php.ini I set the following:

extension_dir = "C:\php\ext"

extension=php_ldap.dll

Then, I made sure the dll was available at that path, yep, it's there:

enter image description here

phpinfo shows that I am editing the correct php.ini and the extension_dir is updated.

However, when I start Apache, php_ldap.dll is not loaded.

The Apache logs show this warning:

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

How can I fix this?

Also, what's with the \\? Why is it doubling the "\" and is that the problem?

4
  • 1
    double \\ is for escaping the first \ and no it is not the problem Commented Jul 17, 2016 at 1:08
  • I am not sure if that is the issue but try replacing extension_dir = "C:\php\ext" with extension_dir = "C:\php\ext\" Commented Jul 17, 2016 at 1:15
  • 1
    Notice that the ldap extension also needs the following two libraries libeay32.dll and ssleay32.dll. You need to make sure so these two libraries are in your PATH, for example under C:\Windows\System32. php.net/manual/en/ldap.installation.php Commented Jul 17, 2016 at 1:15
  • stackoverflow.com/questions/12348/… also have a look if here it might lead you somewhere Commented Jul 17, 2016 at 1:20

2 Answers 2

3

My best guess would be that a needed library is missing from your system. The php_ldap extensions requires that both libeay32.dll and ssleay32.dll is installed on the system:

From the ldap installation manual:

Note: Note to Win32 Users

In order for this extension to work, there are DLL files that must be available to the Windows system PATH. For information on how to do this, see the FAQ entitled "How do I add my PHP directory to the PATH on Windows". Although copying DLL files from the PHP folder into the Windows system directory also works (because the system directory is by default in the system's PATH), this is not recommended. This extension requires the following files to be in the PATH: libeay32.dll and ssleay32.dll Versions before PHP 4.3.0 additionally require libsasl.dll.

Sign up to request clarification or add additional context in comments.

Comments

0

Do not use backslash in the php.ini !

Always slash in the php.ini even on Windows system.

extension_dir = "C:/php/ext"

extension=php_ldap.dll

2 Comments

While this may be good advice, its probably better suited as a comment than an answer since it doesn’t actually address the problem
i had the same extension problem on my windows system. extension_dir = "C:/phpintalldir/ext" vas the key.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.