Laravel,为 CLI 启用 MCrypt
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17480402/
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
Laravel, enable MCrypt for CLI
提问by Tarik
i know the question was asked allot, but most answers were for linux/xOS systems and no thread about windows, lately im trying to learn laravel which need mcrypt extention enabled which was easy with wampmanager and it worked fine, but the CLI using php artisan doesnt work and only dd Laravel requires the Mcrypt PHP extension.I only have one version of php and accessing the php.ini i only find
我知道这个问题被问到了,但大多数答案都是针对 linux/xOS 系统的,没有关于 windows 的线程,最近我试图学习需要启用 mcrypt 扩展的 laravel,这对 wampmanager 来说很容易,而且工作正常,但是 CLI 使用 php artisan不起作用,只有 dd Laravel 需要 Mcrypt PHP 扩展。我只有一个版本的 php 并且访问 php.ini 我只找到
[mcrypt]
; For more information about mcrypt settings see http://php.net/mcrypt-module-open
; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
mcrypt.algorithms_dir=
; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
mcrypt.modes_dir=
i tried configuring it by downloading libmcrypt and setting it in php\ext with no avail
我尝试通过下载 libmcrypt 并在 php\ext 中设置它来配置它,但无济于事
回答by edenstrom
Run php --ini
to find out which config files are loaded.
运行php --ini
以找出加载了哪些配置文件。
CLI could use another config-file than php.ini.
CLI 可以使用另一个配置文件而不是 php.ini。
EDIT:
编辑:
Make sure the file got these things correct:
确保文件正确处理这些内容:
extension_dir
This should point to your extension-directory. There may be a line there which you could just uncomment. Otherwise it's probably "ext/" or something like that.
extension_dir
这应该指向您的扩展目录。那里可能有一行您可以取消注释。否则它可能是“ext/”或类似的东西。
Also, make sure
另外,请确保
extension=php_mcrypt.dll
is uncommented.
extension=php_mcrypt.dll
未注释。
You can use php -info
to check what extensions are available.
您可以使用php -info
来检查哪些扩展可用。