On the program error and level ini_ set(“display_ errors”,”On”)

Knowledge map advanced must read: read how large-scale map data efficient storage and retrieval>>>

When using PHP to do website development, in order to prevent users from seeing error messages, the unfriendly interface appears. Therefore, in general, display will be set in php.ini_ errors = Off; However, during development, we sometimes need to open error messages. At this time, you can set: 1. Ini in the PHP file_ set(“display_ errors”,”On”); 2. error_ reporting(E_ ALL); However, sometimes we can’t display the syntax errors in PHP even if we set it like this in time. This is due to the syntax error of the PHP file, which causes the file not to be executed at all, so of course no error message will be displayed. Solution: suppose there is a syntax error in this PHP, you can create a new test.php and edit it in this PHP as follows: ini_ set(“display_ errors”,”On”); error_ reporting(E_ ALL); Include (“target file”); In this way, when you are running test. PHP, the program will report syntax errors_ reporting(“E_ All “) and ini_ set(“display_ What is the difference between “errors” and “on”?If the latter is off, the former is useless even for e-all

Similar Posts: