fleaphp FleaPHP security settings method

WBOY
Release: 2016-07-29 08:38:48
Original
1193 people have browsed it

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 password similar to sdfsdf12312SDCVd/Flea
4. Change the directory name of the default CMT 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 the constructor of FLEA's exception handling class FLEA_Exception. My personal idea can be changed when the program hangs
// Get the file and code that throws the exception Line number
$last = array_shift($this->trac);
$this->file = $last['file'];
$this->line = $last['line'];
this part
The above introduces the security setting method of fleaphp, including fleaphp content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template