Windows 上的 Apache 找不到 php 扩展 [英] Apache on Windows cant find php extensions

查看:35
本文介绍了Windows 上的 Apache 找不到 php 扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows Server 2012 上安装了 Apache 2.4 和 php.

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

我正在尝试加载 php_ldap.dll 扩展.

Im trying to load the php_ldap.dll extension.

这是我所做的:

php.ini 中,我设置了以下内容:

In php.ini I set the following:

extension_dir = "C:\php\ext"

extension=php_ldap.dll

然后,我确保 dll 在该路径上可用,是的,它就在那里:

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

phpinfo 显示我正在编辑正确的 php.ini 并且 extension_dir 已更新.

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

但是,当我启动 Apache 时,没有加载 php_ldap.dll.

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

Apache 日志显示此警告:

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

我该如何解决这个问题?

另外,\\ 有什么用?为什么将\"加倍,这就是问题所在?

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

推荐答案

我最好的猜测是您的系统中缺少所需的库.php_ldap 扩展要求 libeay32.dllssleay32.dll 都安装在系统上:

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:

来自 ldap 安装手册:

注意:Win32 用户注意

Note: Note to Win32 Users

为了让这个扩展工作,必须有 DLL 文件可用于 Windows 系统路径.有关如何操作的信息对此,请参阅题为如何将我的 PHP 目录添加到 PATH 中"的常见问题解答在 Windows 上".虽然将 DLL 文件从 PHP 文件夹复制到Windows 系统目录也有效(因为系统目录是默认在系统的 PATH 中),不推荐这样做.这个扩展需要以下文件在 PATH 中:libeay32.dll和 PHP 4.3.0 之前的 ssleay32.dll 版本另外需要libsasl.dll.

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.

这篇关于Windows 上的 Apache 找不到 php 扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆