【问题标题】:Kohana ErrorException [ 8 ]Kohana 错误异常 [ 8 ]
【发布时间】:2013-07-03 11:45:09
【问题描述】:

安装和配置 Kohana 后,我重命名了 install.php 文件(根据用户指南)。但是当我现在转到 localhost/kohana 时,我收到以下错误:

 ErrorException [ 8 ]: Array to string conversion ~ SYSPATH/classes/Kohana/Log/Writer.php [ 81 ]

我在网络上的其他地方找不到解决方案。有谁知道如何解决这个问题?谢谢!

【问题讨论】:

  • Kohana 有自己的论坛。这不是编程,错误是软件产品支持问题。
  • 感谢您的信息:)

标签: php kohana kohana-3


【解决方案1】:

这是一个 Kohana 3.3 版本的错误。更多详情请查看here

【讨论】:

    【解决方案2】:

    这是该错误的修补程序。希望这对其他人有帮助 https://github.com/kohana/core/commit/82b470b2827470da37b0e6771b77c369c3d2e5fb

    classes/Kohana/Log/Writer.php

     public function format_message(array $message, $format = "time --- level: body in   file:line")
        {
         $message['time'] = Date::formatted_time('@'.$message['time'], Log_Writer::$timestamp, Log_Writer::$timezone, TRUE);
         $message['level'] = $this->_log_levels[$message['level']];
    
    -    // FIX: $message should consist of an array of strings
    -    $message = array_filter($message, 'is_string');
    -
    -    $string = strtr($format, $message);
    +    $string = strtr($format, array_filter($message, 'is_scalar'));
    
         if (isset($message['additional']['exception']))
         {
           $message['body'] = $message['additional']['exception']->getTraceAsString();
           $message['level'] = $this->_log_levels[Log_Writer::$strace_level];
    
     -     $string .= PHP_EOL.strtr($format, $message);
     +     $string .= PHP_EOL.strtr($format, array_filter($message, 'is_scalar'));
         }
    
       return $string;
    

    注意到 '+' 表示添加的行,'-' 表示从 v3.3 中删除的行

    【讨论】:

    • 这是仅链接的答案。
    • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会失效。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多