在 PHP 安装上启用 Mcrypt
我使用 Apache 2.2.16 在 Windows 机器上安装了 PHP 5.2.14(通过 .msi 安装)。安装附带了 ext/php_mcrypt.dll 和 libmcrypt.dll,但是当我在 php.ini 中取消注释 extension=php_mcrypt.dll 并重新启动 Apache 时,它无法启用。 phpinfo() 没有显示任何内容。我缺少什么?
更新:
我查看了我的错误日志,它向我吐露了这一点:
PHP 警告:PHP 启动:无法加载动态库 'C:\PHP5\ext\php_mcrypt.dll' - 找不到指定的模块。\r\n 在第 0 行的未知
我读到关于这一点,我没有任何 php dll 存储在 windows32/ 文件夹中,所以我很困惑。
I have PHP 5.2.14 installed on a Windows box (installed via .msi) using Apache 2.2.16. The install came with both ext/php_mcrypt.dll and libmcrypt.dll but when I uncommented extension=php_mcrypt.dll in php.ini and restarted Apache it doesn't enable. phpinfo() shows nothing for it. What am I missing?
UPDATE:
I looked at my error logs and it spit this out to me:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP5\ext\php_mcrypt.dll' - The specified module could not be found.\r\n in Unknown on line 0
I read up a bit about this and I don't have any php dll's stored in the windows32/ folder, so I'm confused.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
其他答案具有检查
\ext\php_mcrypt.dll
是否存在并在php.ini
中启用扩展的必要步骤。除此之外,还需要将{Your-PHP-Root}\libmcrypt.dll
复制到{Your-Apache-Root}\bin
,然后重启apache,问题应该会出现得到解决。The other answers has the necessary steps about check the
\ext\php_mcrypt.dll
exists and enable the extension inphp.ini
. Beside this, you need to copy{Your-PHP-Root}\libmcrypt.dll
to{Your-Apache-Root}\bin
, then restart apache, the problem should be solved.我通过结合教程弄清楚了这一点:
值得庆幸的是,不需要重新启动系统。无论上述一项或两项是否有必要,现在 mcrypt 已经正常运行了,这并不重要。谢谢大家。
I figured it out through a combination of tutorials:
Thankfully, no system reboot was required. Whether one or both of the above was necessary, it doesn't matter now that mcrypt is functioning. Thanks, everyone.
您需要先安装它,或者可能将库的路径添加到您的 Windows PATH 环境变量中,因为您正在 Windows 上工作。尝试: http://www.php.net/manual/en/mcrypt.installation .php
(您可以在此处阅读“如果您希望在 Windows 上安装 mcrypt,您还应该将 libmcrypt.dll 放入系统的 PATH 中。”)
如何设置或编辑环境变量:http://www.support.tabs3.com/main/R10463.htm
You need to install it first, or maybe add the route to the library to your windows PATH enviroment variable, since you are working on windows. Try: http://www.php.net/manual/en/mcrypt.installation.php
(There you can read "If you wish to install mcrypt on Windows, you should also place libmcrypt.dll in the PATH of your system.")
How to set or edit an enviroment variable: http://www.support.tabs3.com/main/R10463.htm