windows mcrypt 和 IIS - 模块未在 PHP 中加载
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/202867/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
mcrypt and IIS - module does not load in PHP
提问by
I have Windows 2003 Standard, IIS 6, PHP, MySQL and amy trying to get mcrypt working so I can use phpMyAdmin.
我有 Windows 2003 Standard、IIS 6、PHP、MySQL 和 amy,我试图让 mcrypt 正常工作,以便我可以使用 phpMyAdmin。
I have uncommended php_mcrypt.dll in php.ini and this file is in my extensions folder (c:\php).
我在 php.ini 中有不推荐的 php_mcrypt.dll,这个文件在我的扩展文件夹 (c:\php) 中。
I have downloaded libmcrypt.dll to c:\php, c:\php\ext, c:\windows, c:\windows\system32. I have also found a second version of this file on the next and tried that. After each change I have restarted IIS.
我已将 libmcrypt.dll 下载到 c:\php、c:\php\ext、c:\windows、c:\windows\system32。我还在下一个找到了这个文件的第二个版本并尝试了它。每次更改后,我都重新启动了 IIS。
Whatever I try mcrypt does not seem to be loaded when I check php_info();. But there are no errors showing.
当我检查 php_info(); 时,无论我尝试什么 mcrypt 似乎都没有加载。但是没有显示错误。
Is there another version of php_mcrypt.dll? does anyone have a version of phpMyAdmin that does not need mcrypt? Has anyone experienced this problem / have a solution?
是否有其他版本的 php_mcrypt.dll?有没有人有不需要 mcrypt 的 phpMyAdmin 版本?有没有人遇到过这个问题/有解决方案吗?
All help will be greatly apprecaited.
所有帮助将不胜感激。
Many thanks,
非常感谢,
Tim
蒂姆
回答by
I had the same problem and found that the version of libmcrypt.dll I had was corrupt and when I downloaded a version from the net it was fine. As you have already done this I doubt this helps?
我遇到了同样的问题,发现我的 libmcrypt.dll 版本已损坏,当我从网上下载一个版本时,它很好。由于您已经这样做了,我怀疑这有帮助吗?
回答by umberto
We had the same issue on W2k3(x64)/IIS6/PHP5.2.17. Copying libmcrypt.dllto %WINDIR%\SysWOW64and an IISRESETsolved the problem.
我们在 W2k3( x64)/IIS6/PHP5.2.17上遇到了同样的问题。将libmcrypt.dll复制到%WINDIR%\SysWOW64和IISRESET解决了该问题。
回答by umberto
In my case, my site gave the error "PHP Warning: mcrypt_decrypt()..."
I use IIS6 - Plesk - PHP 2.5
So, I updated PHP version in Plesk CP to 5.3 and then the error disappeared.
Hope this helps somebody.
就我而言,我的站点给出了错误“PHP 警告:mcrypt_decrypt()...”
我使用的是 IIS6 - Plesk - PHP 2.5
所以,我将 Plesk CP 中的 PHP 版本更新为 5.3,然后错误消失了。
希望这可以帮助某人。
回答by umberto
- Make sure your extension_dir in php.ini points to the right path (e.g. c:/php5/ext)
- Try restarting windows after each change instead of IIS.
- libmcrypt.dll only has to be in c:\windows\system32
- To be sure mcrypt is (not) loaded, use phpinfo() to check.
- 确保 php.ini 中的 extension_dir 指向正确的路径(例如 c:/php5/ext)
- 每次更改后尝试重新启动 Windows 而不是 IIS。
- libmcrypt.dll 只需要在 c:\windows\system32
- 要确保(未)加载 mcrypt,请使用 phpinfo() 进行检查。
I'm also having difficulty getting mcrypt to load, but above has helped me a lot in getting closer to a solution.
我也很难让 mcrypt 加载,但以上帮助我更接近解决方案。
回答by Javache
Try starting php from the commandline with php -m. It will show you a list of loaded modules.
尝试使用php -m从命令行启动 php 。它将向您显示已加载模块的列表。
回答by Matthew Purdon
I was having a weird issue with Win 2k3 Server + IIS 6 + PHP 5.2.9 + mcrypt as well. As soon as I added the mcrypt (or mhash for that matter) extension, fastcgi just timed out. When I removed those extensions from php.ini I see my phpinfo() page as expected. The really weird part was that I could see the module loaded when I run php -m from the command line.
我在 Win 2k3 Server + IIS 6 + PHP 5.2.9 + mcrypt 上也遇到了一个奇怪的问题。一旦我添加了 mcrypt(或 mhash)扩展名,fastcgi 就超时了。当我从 php.ini 中删除这些扩展时,我会按预期看到我的 phpinfo() 页面。真正奇怪的是,当我从命令行运行 php -m 时,我可以看到加载的模块。
I grabbed all of the dlls from XAMPP (in the php folder) and stuck them all in my PHP installation folder (C:\Program Files\PHP for me). After making the the change to my php.ini
我从 XAMPP(在 php 文件夹中)获取了所有的 dll 并将它们全部粘贴在我的 PHP 安装文件夹中(对我来说是 C:\Program Files\PHP)。对我的 php.ini 进行更改后
extension=php_mcrypt.dll
扩展名=php_mcrypt.dll
I restarted IIS completely rather than recycling the App Pool and my phpinfo page worked as expected. I am not sure why but fastcgi wasn't able to "see" the libraries in the system32 folder, I had to put them in my php root folder.
我完全重新启动了 IIS 而不是回收应用程序池,我的 phpinfo 页面按预期工作。我不确定为什么但 fastcgi 无法“看到”system32 文件夹中的库,我不得不将它们放在我的 php 根文件夹中。
Good luck.
祝你好运。