Apache on Windows cant find php extensions

那年仲夏 提交于 2019-12-24 07:58:57

问题


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:

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?


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/38417031/apache-on-windows-cant-find-php-extensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!