Write a build verification code, but cannot display the picture in the local wampsever environment
But I uploaded it to the server, but I can show it.
The local GD library is open
Novice make confused, ask for advice!
Reply content:
Write a build verification code, but cannot display the picture in the local wampsever environment
But I uploaded it to the server, but I can show it.
The local GD library is open
Novice make confused, ask for advice!
The picture is not displayed generally because the generated picture stream is not correct, you directly in the browser open the address of this image.
Perhaps you will find:
php
Fatal error :xxxxxx or Warning : xxxxx
The error prompt.
In addition, the general local is open Display_erorrs, but the server production environment inside for security is to shut down all the error output.
- Check file encoding,
utf-8
usually.
- Try to clean the
ob_clean();
wrong output buffer.
This piece of code, why look so familiar with ...!
The main topic should be extracted from the PHP e-commerce Web development tutorials on the web.
This code has a bug, that is, in the
$fontfiles =array ("Simyou. TTF ");
$fontfile = '. /fonts/'. $fontfiles [Mt_rand (0, Count ($fontfiles)-1)];
Fonts folder, you did not place Simyou.ttf or other related font files, so the server could not find the font.
Just fill in the TTF font file.
The output verification code can not have other content output!!
For your situation, it is because your local environment display_errors open,
You just need to be on top, that's require_once '. /include.php '; The top of this line is added Ini_set (' display_errors ', ' Off '); You can do it.
Besides, your .