Home  >  Article  >  Backend Development  >  The verification code can be generated on the PHP server, but not locally. How strange?

The verification code can be generated on the PHP server, but not locally. How strange?

WBOY
WBOYOriginal
2016-08-18 09:16:011185browse

This is local

The verification code can be generated on the PHP server, but not locally. How strange?

This is from the server

The verification code can be generated on the PHP server, but not locally. How strange?

What is the reason

The verification code can be generated on the PHP server, but not locally. How strange?

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>

Reply content:

This is local

The verification code can be generated on the PHP server, but not locally. How strange?

This is from the server

The verification code can be generated on the PHP server, but not locally. How strange?

What is the reason

The verification code can be generated on the PHP server, but not locally. How strange?

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:

  1. The GD library is not installed locally, or the correct font is not installed, or the GD library is installed without restarting

  2. 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

  3. When generating the verification code, the directory does not have permission

  4. 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>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn