The example in this article describes the perfect solution to the problem that thinkphp verification code cannot be displayed due to errors. Share it with everyone for your reference. The specific analysis is as follows:
I finished the verification code part today, and I was very happy when I thought that TP comes with a verification picture, but I couldn’t come up with it after tinkering for a long time, and I always looked like a little X.
Official tips are as follows:
If the verification code cannot be displayed, please check:
① Whether PHP has installed GD library support;
② Is there any output before output (especially the BOM header information output of UTF8);
③ Whether the Image class library is imported correctly;
④ If it is a Chinese verification code, check whether the font file has been copied to the directory where the class library is located;
But after half a day of testing, it didn’t work! I found a usable method on the Internet and put it in a file to execute. Enter tp through the index.php entry and enter the small A small
Similar to: