Create a verification code, suddenly a large number of errors, please help look, thank you I am trying to write a verification code php script, first began to prompt the image function is not available, so I added the php5-gd
After the installation is complete, it is found that the function still cannot be found by Tieshi.
So I used sudo/etc/init. d/apache2 focus-reload.
Then a function problem is prompted, but a large amount of warning information is displayed.
I have checked and modified the php. ini file error. report = E_ALL &~ E_NOTICE
Restart the server,
The verification code is as follows:
Reply to discussion (solution)
Check by yourself. The definition and usage of constants are inconsistent.
Check by yourself. The definition and usage of constants are inconsistent.
Thanks to the moderator, an error has caused so many problems that I have no patience. but now the imagettftext () function cannot find the font. I didn't see the font after reading the manual. how can I find it? How do I set the font path? does the font path refer to the font path of linux or the font of the gd library?
The absolute path must be used for font files. you can write them wherever you put them.
Obviously 23 rows have been prompted. the denominator in your division cannot be zero because there is an incorrect inversion here. $ the img variable contains miscellaneous values, so that the imagesetpixel function of 27 rows does not have an available image resource.
for($i=0;$i<5;$i++){ imageline($img,0,rand()%IDENTFY_HEIGHT,IDENTFY_WIDTH,rand()%INDENTFY_HEIGHT,$graphic_color); }
for($i=0;$i<50;$i++){ imagesetpixel($img,rand()%IDENTFY_WIDTH,rand()%IDENTFY_HEIGHT,$graphic_color); }
Obviously 23 rows have been prompted. the denominator in your division cannot be zero because there is an incorrect inversion here. $ the img variable contains miscellaneous values, so that the imagesetpixel function of 27 rows does not have an available image resource.
for($i=0;$i<5;$i++){ imageline($img,0,rand()%IDENTFY_HEIGHT,IDENTFY_WIDTH,rand()%INDENTFY_HEIGHT,$graphic_color); }
for($i=0;$i<50;$i++){ imagesetpixel($img,rand()%IDENTFY_WIDTH,rand()%IDENTFY_HEIGHT,$graphic_color); }
for($i=0;$i<5;$i++){ imageline($img,0,rand()%IDENTFY_HEIGHT,IDENTFY_WIDTH,rand()%INDENTFY_HEIGHT,$graphic_color); }
for($i=0;$i<50;$i++){ imagesetpixel($img,rand()%IDENTFY_WIDTH,rand()%IDENTFY_HEIGHT,$graphic_color); }