Solution to thinkphp's token verification failure: 1. Turn off debug mode; 2. Open the config.php file and turn off page trace information output by setting "'SHOW_PAGE_TRACE' => false,"; 3. Enable sae engine is enough.
The operating environment of this tutorial: Windows 7 system, ThinkPHP version 5, Dell G3 computer.
What should I do if the token verification of thinkphp fails?
thinkphp WeChat development token verification failed
In the past few days, token verification has always failed when using WeChat
Finally found a solution online!
These days when I use WeChat, I always fail to verify the token.
After many searches, I finally found the problem.
is because page output and debugging mode are turned on when writing code.
The summary is as follows:
Note: Turn off debug mode. Turn off the trace information output on the page and enable the sae engine
Do these three steps and the configuration will be successful without any problems
config.php文件: 'SHOW_PAGE_TRACE' =>false, // 显示页面Trace信息 index.php文件: define('APP_DEBUG', false); define('ENGINE_NAME','sae');
It is recorded here for everyone to avoid such low-level errors.
Recommended learning: "thinkPHP Video Tutorial"
The above is the detailed content of What to do if thinkphp token verification fails. For more information, please follow other related articles on the PHP Chinese website!