安装错误:请将 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 12:09:58  来源:igfitidea点击:

Installation error: Please change the value of 'Security.salt' in app/config/core.php to a salt value specific to your application

phpcakephp

提问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:

你只需要按照它说的做:

  1. Edit yourInstallation*/app/config/core.php
  2. Search for Security.saltand 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.
  3. Do the same with Security.cipherSeedbut use only numbers
  4. Save core.php
  1. 编辑 yourInstallation*/app/config/core.php
  2. 搜索Security.salt并更改一些随机字符(这是为了让您的应用程序没有与其他十亿个安装相同的安全种子,这将是一个严重的安全漏洞。
  3. 做同样的事情,Security.cipherSeed但只使用数字
  4. 节省 core.php

Now read core.php- you'll learn a lot from doing that.

现在阅读core.php- 你会从中学到很多东西。

回答by Tarun Upadhyay

  1. Go to your CakePHP app folder.

  2. Enter the config folder and open core.php

  3. 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', '');
    
  1. 转到您的 CakePHP 应用程序文件夹。

  2. 进入配置文件夹并打开 core.php

  3. 你会在某处看到这些行:

    /**
     * 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 可选配置