Home  >  Article  >  Backend Development  >  FleaPHP security settings method_PHP tutorial

FleaPHP security settings method_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:49:15928browse

Prerequisites:
Virtual machine, the fleaphp folder cannot be placed in a path that is inaccessible to http, and the configuration files of apache and php cannot be modified.
fleaphp uses default configuration
Method:

1. Place the controller folder outside the root directory (this method is only suitable if you have a server)
2. In the controller file, try not to explicitly output such as echo print, etc.
3. To hide the controller directory, take a folder with a similar password: sdfsdf12312SDCVd/Flea
4. Change the default CMT directory name through the configuration file
5. Place an .htaccess under the root directory to prohibit access to certain directories. (Only suitable for apache server)
6 When no configuration file can be modified, except index.php, all MVC layer files must be preceded by
defined('APP_DIR') or header("HTTP/ 1.0 404 Not Found"); and it is best to change 'APP_DIR' to a name that is difficult to guess
7. Placing an empty index.htm file in the directory is also one of the ways to prevent directory leakage.
8.

function FLEA_Exception($message = null, $code = 0)
{
$this->message = $message;
$this->code = $code;
$this->trac = debug_backtrace();

// Get the file and code line number where the exception was thrown
$last = array_shift($this->trac );
$this->file = $last['file'];
$this->line = $last['line'];
}
This is a FLEA processing exception The constructor of class FLEA_Exception. My personal idea is that you can change it when the program hangs up
// Get the file and code line number where the exception was thrown
$last = array_shift($this->trac);
$this->file = $last['file'];
$this->line = $last['line'];
this part

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319559.htmlTechArticlePrerequisite: Virtual machine, the fleaphp folder cannot be placed in a path that is inaccessible to http, and apache and php cannot be modified. configuration file. fleaphp uses default configuration method: 1. controller text...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn