Setting php. ini Security

Source: Internet
Author: User

Php is a popular server-side scripting language, for/etc/php. ini: # disable the dangerous function disable_functions = phpinfo, system, mail, exec ## restrict resources ### maximum execution time of each script, unit: seconds max_execution_time = 30 # maximum time for each script to parse request data max_input_time = 60 # maximum memory (8 MB) that can be consumed by each script) memory_limit = 8 M # maximum size of POST data to be received by PHP post_max_size = 8 M # whether to allow uploading file_uploads = Off # maximum file size allowed to be uploaded upload_max_filesize = 2 M # No PHP error messages are exposed to external users display_errors = Off # enable security mode safe_mode = On # Only allow access to the executable file safe_mode_exec_dir = php-required-executables-path # Restrict external access PHP resource safe_mode_allowed_env_vars = PHP _ # Restrict leakage of PHP information expose_php = Off # record all errors log_errors = On # do not register global register_globals = Off for input data # minimize allowed php post size post_max_size 1 K # ensure that PHP redirection is correct cgi. force_redirect = 0 # upload prohibited, unless necessary, file_uploads = Off # enable SQL security mode SQL. safe_mode = On # avoid opening the remote file allow_url_fopen = Off

Related Article

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.