无法加载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转储中不可见.我尝试重新启动服务器并达到大约一百万次,而没有任何运气.因此,如果有人知道解决方案,那就太好了.
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屋!