安装错误:请将app/config/core.php中'Security.salt'的值更改为特定于您的应用程序的salt值

anu*_*dha 15 php cakephp

在尝试安装CakePHP时,我收到有关更改salt和密码种子值的以下错误消息.我该如何更改这些值?

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]
Run Code Online (Sandbox Code Playgroud)

Leo*_*Leo 54

你只需按照它说:

  1. 编辑 yourInstallation*/app/config/core.php
  2. 搜索Security.salt并更改一些随机字符(这是因为您的应用程序没有与十亿其他安装相同的安全种子,这将是一个严重的安全漏洞.
  3. 做同样Security.cipherSeed但只使用数字
  4. 保存 core.php

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

  • 耶稣,如果它你很难改变一个血腥的字符串.. ^^只是改变它的一个单一的字符(如"a"到"b")你就没事了.虽然我没有看到你面前的光明前景.我的意思是,来自错误消息的指令和来自这里的答案的指令尽可能干净和直接 (14认同)

Tar*_*yay 21

  1. 转到CakePHP应用程序文件夹.

  2. 输入config文件夹并打开 core.php

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

    /**
     * A random string used in security hashing methods.
     */
    
    
    Configure::write('Security.salt', 'xxxxxxxxxxxxxxxxxxxxxxx');
    
    Run Code Online (Sandbox Code Playgroud)

    如果你的CakePHP版本是1.3或更高,那么这也将是:

    /**
     * A random numeric string (digits only) used to encrypt/decrypt strings.
     */
    
    
    Configure::write('Security.cipherSeed', 'xxxxxxxxxxxxxxxxxxxxxxx');
    
    Run Code Online (Sandbox Code Playgroud)

    只需更改以下值:

    Configure::write('Security.cipherSeed', 'xxxxxxxxxxxxxxxxxxxxxxx');
    
    Run Code Online (Sandbox Code Playgroud)

    至:

    Configure::write('Security.cipherSeed', 'xxxxxxxxxxxxxxTxxxxxxxx');
    
    Run Code Online (Sandbox Code Playgroud)

    或任何你的选择.刚开始你也可以将整个值留空:

    Configure::write('Security.cipherSeed', '');
    
    Configure::write('Security.salt', '');
    
    Run Code Online (Sandbox Code Playgroud)

然后保存文件,你就完成了.