Solution to the problem that ThinkPHP verification code always fails:
1. Find the server php configuration file php.ini
Create an info.php file in the root directory of the website.
For example: D:\wwwRoot\wp This is the root directory of the website. In this directory, create a new txt document and enter the following code:
Then save as info.php.
Then access this file in the browser, for example: http://localhost/info.php
Then you can see the location of the php.ini configuration file where the server php actually works , as shown below:
Related recommendations: "ThinkPHP Tutorial"
2. Open the php.ini file with txt and search for: session.save_path = This field (will appear in 4 or 5 places), find the one with the directory. For example:;session.save_path = "/tmp". Remove the previous ; sign, then set the correct directory (for example: c:temp) and save.
#3. Configure all users with modification and read-write permissions (0777) for the correct directory c:temp set in the second step.
#4. Restart IIS and log in to the backend of the website developed by thinkphp. This is very important. If you do not restart, the changes made above will not take effect.
Restart method: Start menu, run, enter iisreset.
The above is the detailed content of What should I do if the ThinkPHP verification code keeps getting errors?. For more information, please follow other related articles on the PHP Chinese website!