_php instance of Fleaphp security setting method

Source: Internet
Author: User
Prerequisites:
Virtual machines, the Fleaphp folder cannot be placed on HTTP inaccessible paths and the Apache and PHP configuration files cannot be modified.
fleaphp Use default configuration
Method:

1. The controller folder is placed outside the root directory (this option is only appropriate for your own server)
2. In controller files, try not to explicitly output such as echo print
3. Hide the controller directory like a password-like folder Sdfsdf12312sdcvd/flea
4, change the directory name of the default CMT through the configuration file
5. Place a. htaccess in the root directory to prevent access to certain directories (Apache servers only)
6 All MVC layer files are in the front with the exception of index.php, without modifying any configuration files
Defined (' App_dir ') or header ("http/1.0 404 Not Found"); and ' app_dir ' better change to a name that's not easy to guess.
7. Placing an empty index.htm file within the directory is also one of the ways to prevent directory leaks.
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 that threw the exception
$last = Array_shift ($this->trac);
$this->file = $last [' file '];
$this->line = $last [' line '];
}
This is the constructor for FLEA to handle the exception class flea_exception. My personal thoughts can be changed when the program hangs up
Get the file and code line number that threw the exception
$last = Array_shift ($this->trac);
$this->file = $last [' file '];
$this->line = $last [' line '];
This Part

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.