PHP has encountered some problems dynamically generating GIF images, which is now resolved and I am using php4.05 (for Win32) +apache3.1.2_win32.
Problem One: A program that dynamically generates GIF does not turn up
I wrote an example about using PHP to generate GIF, running and discovering that the page is not going to brush out, like it was dead, The browser also does not have any error prompts.
Workaround: Modify the php.ini in the directory where PHP is located
Modify the php.ini of the installation PHP path (note: it must be php.ini in the PHP path) extension_dir = Install PHP path Extensions (for example: c:phpextensions).
question two: Php_gd.dll does not support GIF
PHP generates GIF captcha error
I loaded the Php_gd.dll Dynamic Connection Library at the beginning of the program: DL ("Php_gd.dll"), but in the run
<br><b>Warning</b>: Imagegif:no GIF Support in-PHP build in <b>d:apachehtdocsgif2.php3</b> on line <b>12</b>< Br>.
Workaround: Using php4.05
then I found out it was a book question Php_ Gd.dll can not support the generation of GIF, after the expert guide to know their version php4.04 for Win32 lack of php_gd_gif.dll, so I downloaded a later version of the php4.05, which has the support to generate animated GIF php_gd_ Gif.dll.
Issue three: Warning: warning:function registration failed-duplicate Name-imagearc in D:APACHEHTDOCSGIF2.P HP3 on line 3
procedures are as follows:
DL ("Php_gd_gif.dll");
Header ("Content-type:image/gif");
$im = imagecreate (400,30);
$black = imagecolorallocate ($im, 0,0,0);
$white = imagecolorallocate ($im, 255,255,255);
Imageline ($im, 200,15,215,15, $white);
Imagestring ($im, 5, 4, "This is a Gif", $white);
Imagegif ($im);
Imagedestroy ($im);
?
Workaround: Modify program or php.ini
dl () function is used to load DLLs. But if the ";" in front of the required DLL is in the php.ini file have been removed, then do not use this function.
if the ";" Before extension=php_gd_gif.dll in the INI file No, then use DL ("Php_gd_gif.dll"); load, in short: The two are different, otherwise the server thinks it is a duplicate name.