Sodium 未在 XAMPP PHP 7.2 上加载

2022-01-14 00:00:00 xampp php libsodium

嘿,由于某种原因,当我使用 XAMPP PHP 7.2 时,所有的钠函数都不起作用.当我运行 print_r(get_loaded_extensions()); 它不会在列表中显示钠.当我去 http://php.net/manual/en/sodium.installation.php 它说不需要安装它们是核心的一部分.所以我去了我的 php.ini 配置文件并确保它没有禁用钠,它说 extension=php_sodium.dll.我去控制台仔细检查他们是否有任何错误,没有.这很奇怪,因为 Argon2i 工作正常.Argon2i 常量都已定义,当在 password_hash() 函数中使用时,它会生成密码哈希没有问题.我使用 Windows 作为我的操作系统.还有什么可能导致这样的事情,任何帮助都会很好.提前致谢.

Hey for some reason when i use XAMPP PHP 7.2, all of the sodium functions are not working. When i run print_r(get_loaded_extensions()); it does not show sodium on the list. When i go to http://php.net/manual/en/sodium.installation.php it says no installation needed they are a part of the core. So i went to my php.ini configuration file and made sure that it did not disable sodium, it says extension=php_sodium.dll. I went to the console to double check to see if their were any errors, there was none. It was weird because Argon2i is working fine. The Argon2i constants are all defined and when used in the password_hash() function it generates a password hash no problem. I am using windows as my OS. Is there anything else that can cause something like this, any help would be nice. Thanks in advance.

推荐答案

你确定你编辑了正确的 php.ini 吗?

Are you sure that you edit the correct php.ini?

从 PHP 7.2 开始,ini 文件(至少在我的 Windows PC 上),加载扩展的语法现在是 extension=modulename 而不是 extension=php_modulename.dll.

Starting with PHP 7.2, ini file (at least on my Windows PC), the syntax to load extension is now extension=modulename instead of extension=php_modulename.dll.

相关文章