Home > Article > Backend Development > The verification code can be generated on the PHP server, but not locally. How strange?
This is local
This is from the server
What is the reason
This is the chkcode code
<code>header("Content-type: image/gif"); $imagecode = new Verify\Img(160, 50, 5, "23546789qwertyupkjhgfdaszxcvbnm", "./TektonPro-BoldCond.otf"); $imagecode->imageout(); </code>
This is local
This is from the server
What is the reason
This is the chkcode code
<code>header("Content-type: image/gif"); $imagecode = new Verify\Img(160, 50, 5, "23546789qwertyupkjhgfdaszxcvbnm", "./TektonPro-BoldCond.otf"); $imagecode->imageout(); </code>
It’s just those reasons:
The GD library is not installed locally, or the correct font is not installed, or the GD library is installed without restarting
You have opened the source code of chkcode locally with Notepad, and there is a BOM header, but no characters can be output before the header is output
When generating the verification code, the directory does not have permission
If it is Linux, the inode may have been allocated and there is no way to generate a new verification code
Depending on the question, it’s either 1 or 2
The GD library is not installed
<code># apt-get install php5-gd # sudo /etc/init.d/apache2 restart</code>