Provides various official and user-released code examples. For code reference, you are welcome to exchange and learn. I am a newbie to ThinkPHP. After configuring according to the manual, an error will be reported when the program fails at the beginning, and no error will be reported later! After several queries, no results were found, and the problem was found several times. The following describes my solution.
I am posting for the first time. I hope the name of T-friends can give more advice and communicate with each other.
The following code is basically available during entry code development.
define('APP_PATH','./Application/');
// define('APP_DEBUG', TRUE);
include './ThinkPHP/ThinkPHP.php';
?>
When an error occurs in the program, a blank page is displayed. The first response is: Why?
There are many solutions on the Internet, and some knowledge is essential for beginners of PHP.
========================================================== ======
Add error_reporting (E_ALL) to the first line)
In php. ini, find display_errors = Off and change it to display_errors = On.
This method can no longer be used as a foundation, but the blank page of ThinkPHP cannot be reached.
========================================================== ======
Add the following code to the configuration file:
'Show _ PAGE_TRACE '=> true
This method is good and can display all the information during the ThinkPHP program running process, but it is powerless for blank pages.
========================================================== ======
Finally, my solution is:
'Tmpl _ EXCEPTION_FILE '=> 'public: exception', // template file of the Exception page
I configured a template file with an exception page, but the code in the code file on this page is not completely written, resulting in the failure to display PHP errors, so a blank page is displayed.
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB