How can I turn on PHP errors display on just a subfolder

前端 未结 4 1263
你的背包
你的背包 2020-12-31 04:59

I don\'t want PHP errors to display /html, but I want them to display in /html/beta/usercomponent. Everything is set up so that errors do not displ

4条回答
  •  萌比男神i
    2020-12-31 05:30

    The easiest way would be to control the error reporting from a .htaccess file. But this is assuming you are using Apache and the scripts in /html/beta/usercomponent are called from that directory and not included from elsewhere.

    .htacess

    php_value error_reporting [int]
    

    You will have to compose the integer value yourself from the list as described in the error_reporting documentation, since the constants like E_ERROR aren't defined when Apache interprets the .htaccess.

    It's a simple bitwise flag, so a value of 12, for example, would be E_WARNING + E_PARSE + E_NOTICE.

提交回复
热议问题