PHP Windows 扩展不会加载 [英] PHP Windows extensions won´t load
问题描述
我正在使用 Windows Server 2008 R2 机器.我已经用 php 5.4.25 安装了 apache 2.2在尝试为 apache 服务器启用 ldap 支持时,我发现该服务器不加载扩展.
I'm working on a windows server 2008 R2 machine. I have installed apache 2.2 with php 5.4.25 While trying to enable ldap support for the apache server i found out that the server does not load the extensions.
我运行了 php_info() 这就是结果
I ran php_info() and this was the result
配置文件(php.ini)路径
Configuration File (php.ini) Path
C:\Windows 加载的配置文件:"C:\php\php.ini
C:\Windows Loaded configuration file: "C:\php\php.ini
extension_dir C:\php\ext
extension_dir C:\php\ext
我已更改 php.ini 以加载扩展,但它们未加载且在 php_info 转储中不可见.我试图在没有运气的情况下进行更改时重新启动服务器和 apache 大约一百万次.因此,如果有人知道解决方案,那就太好了.
I have changed the php.ini to load the extensions, but they are not loaded and they are not visible in the php_info dump. I tried to restart the server and apache about a million times while doing changes with no luck. So if anyone knows a solution to this it would be great.
推荐答案
我也遇到了很多问题.确保您正在配置正确的 php.ini 文件.出于某种原因,我有两个.
I had a lot of problems with this as well. Make sure you're configuring the right php.ini file. For some reason I had two of them.
这是来自我的 phpinfo()
This is from my phpinfo()
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\wamp\bin\apache\apache2.4.4\bin\php.ini <--- this is the one I needed to manually update
然后我将我的 php_ldap.dll 文件转储到:
Then I dumped my php_ldap.dll file in:
C:\wamp\bin\php\php5.4.16\ext
更新了我的 php.ini 文件以加载扩展
Updated my php.ini file to load the extension
将 PHP 目录添加到 Windows 路径中.
Added the PHP directory to the Windows path.
更多信息请访问:http://www.php.net/manual/en/faq.installation.php#faq.installation.addtopath
我的看起来像
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Shoreline Communications\ShoreWare Client\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;c:\wamp\bin\php\php5.4.16
图片:http://i.imgur.com/hQUwtYA.png
重新启动机器,它工作了.
Rebooted machine and it worked.
这篇关于PHP Windows 扩展不会加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!