PHP-. htaccess Settings Display PHP error (RPM)

Source: Internet
Author: User
Tags php error

Use the. htaccess setting to display PHP error usage. htaccess can change the error display settings of PHP to some extent, in fact, the equivalent of changing the parameters of php.ini, is very convenient. You can do this by placing the following code in the. htaccess file in the appropriate directory. Off error display: Php_flag display_startup_errors offphp_flag display_errors offphp_flag html_ Errors offphp_value docref_root 0php_value docref_ext 0 only PHP errors are displayed:php_flag   Display_errors        onphp_flag  display_startup_errors  onphp_value error_reporting        2047 where, "2047" is the level of error to display, The detailed table is as follows: 1 e_error2 e_warning4 e_parse8 e_notice16 e_core_error32 e_core_warning64  e_compile_error128 e_compile_warning256 e_user_error512 e_user_warning1024 e_user_ notice2047 e_all2048 e_strict4096 e_recoverable_error  to save the error to the log file, you can set this: # enable  php error loggingphp_flag  log_errors onphp_value error_log  / Home/path/public_html/domain/php_errors.log you can then set the not allowed access to the. log file:# prevent access to php error log< Files php_errors.log> order allow,deny deny from all satisfy all </Files> set the maximum size of the error log in bytes: # general directive for setting max error  sizelog_errors_max_len integer integrated above,. htaccess PHP Error display settings Rollup:# php error handling  for production servers# disable display of startup errorsphp_flag  Display_startup_errors off# disable display of all other errorsphp_flag  display_errors off# disable html markup of errorsphp_flag html_errors  off# enable logging of errorsphp_flag log_errors on# disable  ignoring of repeat errorsphp_flag ignore_repeated_errors off# disable  Ignoring of unique source errorsphp_flag ignore_repeated_source off# enable logging of php  memory leaksphp_flag report_memleaks on# preserve most recent error  via php_errormsgphp_flag track_errors on# disable formatting of error  reference linksphp_value docref_root 0# disable formatting of error  reference linksphp_value docref_ext 0# specify path to php error  logphp_value error_log /home/path/public_html/domain/PHP_errors.log# specify  Recording of all php errorsphp_value error_reporting 999999999# disable  max error string lengthphp_value log_errors_max_len 0# protect error  log by preventing public access<files /home/path/public_html/domain/php_ Errors.log> order alloW,deny deny from all satisfy all</files> below are the settings for developer apps: # php error  handling for development serversphp_flag display_startup_errors onphp_flag  display_errors onphp_flag html_errors onphp_flag log_errors onphp_flag  Ignore_repeated_errors offphp_flag ignore_repeated_source offphp_flag report_memleaks  onphp_flag track_errors onphp_value docref_root 0php_value docref_ext 0php _value error_log /home/path/public_html/domain/php_errors.logphp_value error_reporting  999999999php_value log_errors_max_len 0<files /home/path/public_html/domain/php_errors.log > Order allow,deny Deny from all Satisfy All</Files> in short, It is more convenient to display PHP errors through the. htaccess setting to control whether PHP errors appear.

Original address: https://sjolzy.cn/PHP-Htaccess-to-set-PHP-error-display.html

PHP-. htaccess Settings Display PHP error (RPM)

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.