安装错误:请将 app/config/core.php 中 'Security.salt' 的值更改为特定于您的应用程序的 salt 值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4163711/
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
Installation error: Please change the value of 'Security.salt' in app/config/core.php to a salt value specific to your application
提问by anuradha
When trying to install CakePHP, I get the following error message about changing the values of the salt and cipher seed. How can I change these values?
尝试安装 CakePHP 时,我收到以下有关更改盐和密码种子值的错误消息。如何更改这些值?
Notice (1024): Please change the value of 'Security.salt' in app/config/core.php to a salt value specific to your application [CORE\cake\libs\debugger.php, line 684]
Notice (1024): Please change the value of 'Security.cipherSeed' in app/config/core.php to a numeric (digits only) seed value specific to your application [CORE\cake\libs\debugger.php, line 688]
回答by Leo
You just need to do as it says:
你只需要按照它说的做:
- Edit
yourInstallation*/app/config/core.php
- Search for
Security.salt
and change some random characters (this is so your application doesn't have the same security seed as a billion other installations, which would be a serious security loophole. - Do the same with
Security.cipherSeed
but use only numbers - Save
core.php
- 编辑
yourInstallation*/app/config/core.php
- 搜索
Security.salt
并更改一些随机字符(这是为了让您的应用程序没有与其他十亿个安装相同的安全种子,这将是一个严重的安全漏洞。 - 做同样的事情,
Security.cipherSeed
但只使用数字 - 节省
core.php
Now read core.php
- you'll learn a lot from doing that.
现在阅读core.php
- 你会从中学到很多东西。
回答by Tarun Upadhyay
Go to your CakePHP app folder.
Enter the config folder and open
core.php
You will see these lines somewhere:
/** * A random string used in security hashing methods. */ Configure::write('Security.salt', 'xxxxxxxxxxxxxxxxxxxxxxx');
If your CakePHP version is 1.3 or greater then this will also be there:
/** * A random numeric string (digits only) used to encrypt/decrypt strings. */ Configure::write('Security.cipherSeed', 'xxxxxxxxxxxxxxxxxxxxxxx');
Just change the values in:
Configure::write('Security.cipherSeed', 'xxxxxxxxxxxxxxxxxxxxxxx');
to:
Configure::write('Security.cipherSeed', 'xxxxxxxxxxxxxxTxxxxxxxx');
or any of your choice. Just to start you can make whole value blank as well:
Configure::write('Security.cipherSeed', ''); Configure::write('Security.salt', '');
转到您的 CakePHP 应用程序文件夹。
进入配置文件夹并打开
core.php
你会在某处看到这些行:
/** * A random string used in security hashing methods. */ Configure::write('Security.salt', 'xxxxxxxxxxxxxxxxxxxxxxx');
如果您的 CakePHP 版本是 1.3 或更高版本,那么它也会在那里:
/** * A random numeric string (digits only) used to encrypt/decrypt strings. */ Configure::write('Security.cipherSeed', 'xxxxxxxxxxxxxxxxxxxxxxx');
只需更改以下值:
Configure::write('Security.cipherSeed', 'xxxxxxxxxxxxxxxxxxxxxxx');
到:
Configure::write('Security.cipherSeed', 'xxxxxxxxxxxxxxTxxxxxxxx');
或您的任何选择。刚开始,您也可以将整个值设为空白:
Configure::write('Security.cipherSeed', ''); Configure::write('Security.salt', '');
Then save the file, and you're done.
然后保存文件,你就完成了。
回答by Dave
See the cookbook docs - 11.1.4 Optional Configuration
请参阅说明书文档 - 11.1.4 可选配置