2015-04-12 51 views
2

当我打开https://127.0.0.1/mutillidae/然后我的网页上显示这个错误 enter image description here为什么要在kali linux中显示OWASP Mutillidae II PHP WARING?

我也改变许可LoggerAppenderFile.php,但它仍然错误。 该php文件代码是

<?php 
/** 
* Licensed to the Apache Software Foundation (ASF) under one or more 
* contributor license agreements. See the NOTICE file distributed with 
* this work for additional information regarding copyright ownership. 
* The ASF licenses this file to You under the Apache License, Version 2.0 
* (the "License"); you may not use this file except in compliance with 
* the License. You may obtain a copy of the License at 
* 
*  http://www.apache.org/licenses/LICENSE-2.0 
* 
* Unless required by applicable law or agreed to in writing, software 
* distributed under the License is distributed on an "AS IS" BASIS, 
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
* See the License for the specific language governing permissions and 
* limitations under the License. 
* 
* 
* @package log4php 
* @subpackage appenders 
*/ 

/** 
* FileAppender appends log events to a file. 
* 
* Parameters are ({@link $fileName} but option name is <b>file</b>), 
* {@link $append}. 
* 
* @version $Revision: 806678 $ 
* @package log4php 
* @subpackage appenders 
*/ 
class LoggerAppenderFile extends LoggerAppender { 

    /** 
    * @var boolean if {@link $file} exists, appends events. 
    */ 
    private $append = true; 
    /** 
    * @var string the file name used to append events 
    */ 
    protected $fileName; 
    /** 
    * @var mixed file resource 
    */ 
    protected $fp = false; 

    public function __construct($name = '') { 
     parent::__construct($name); 
     $this->requiresLayout = true; 
    } 

    public function __destruct() { 
     $this->close(); 
    } 

    public function activateOptions() { 
     $fileName = $this->getFile(); 

     if(!is_file($fileName)) { 
      $dir = dirname($fileName); 
      if(!is_dir($dir)) { 
       mkdir($dir, 0777, true); 
      } 
     } 

     $this->fp = fopen($fileName, ($this->getAppend()? 'a':'w')); 
     if($this->fp) { 
      if(flock($this->fp, LOCK_EX)) { 
       if($this->getAppend()) { 
        fseek($this->fp, 0, SEEK_END); 
       } 
       fwrite($this->fp, $this->layout->getHeader()); 
       flock($this->fp, LOCK_UN); 
       $this->closed = false; 
      } else { 
       // TODO: should we take some action in this case? 
       $this->closed = true; 
      }   
     } else { 
      $this->closed = true; 
     } 
    } 

    public function close() { 
     if($this->closed != true) { 
      if($this->fp and $this->layout !== null) { 
       if(flock($this->fp, LOCK_EX)) { 
        fwrite($this->fp, $this->layout->getFooter()); 
        flock($this->fp, LOCK_UN); 
       } 
       fclose($this->fp); 
      } 
      $this->closed = true; 
     } 
    } 

    public function append(LoggerLoggingEvent $event) { 
     if($this->fp and $this->layout !== null) { 
      if(flock($this->fp, LOCK_EX)) { 
       fwrite($this->fp, $this->layout->format($event)); 
       flock($this->fp, LOCK_UN); 
      } else { 
       $this->closed = true; 
      } 
     } 
    } 

    /** 
    * Sets and opens the file where the log output will go. 
    * 
    * This is an overloaded method. It can be called with: 
    * - setFile(string $fileName) to set filename. 
    * - setFile(string $fileName, boolean $append) to set filename and append. 
    */ 
    public function setFile() { 
     $numargs = func_num_args(); 
     $args = func_get_args(); 

     if($numargs == 1 and is_string($args[0])) { 
      $this->setFileName($args[0]); 
     } else if ($numargs >=2 and is_string($args[0]) and is_bool($args[1])) { 
      $this->setFile($args[0]); 
      $this->setAppend($args[1]); 
     } 
    } 

    /** 
    * @return string 
    */ 
    public function getFile() { 
     return $this->getFileName(); 
    } 

    /** 
    * @return boolean 
    */ 
    public function getAppend() { 
     return $this->append; 
    } 

    public function setAppend($flag) { 
     $this->append = LoggerOptionConverter::toBoolean($flag, true);   
    } 

    public function setFileName($fileName) { 
     $this->fileName = $fileName; 
    } 

    /** 
    * @return string 
    */ 
    public function getFileName() { 
     return $this->fileName; 
    } 


} 

我该如何解决这个问题? 我在这里找到了http://fanli7.net/a/bianchengyuyan/PHP/20130723/398120.html的解决方案,但是我失败了。如果这个问题无法解决,那么在我的实验室测试中会出现一个大问题?

+0

这不是PHP文件具有错误的权限,而是它试图写入的临时文件。看看第二个警告。 – IMSoP

+0

是的,它缺少一个目录。但我怎么解决它? – Mastan

回答

1

好的。我找到解决方案。其实你设置了旧版本mutillidae。所以这是错误的程序。然后我找到一个新版本。这里是下载链接enter link description here。安装完成后,它会很棒。