Php does not specify to output only html files. It can generate dynamic gif files. I encountered some problems when using php to dynamically generate gif images. Now I am using php4.05 (for win32) apache3.1.2 _ win32.
Problem 1: The program that dynamically generates gif cannot be converted.
I wrote an example about using php to generate gif files and run it. I found that the page could not be flushed, as if it were dead, and there was no error message in the browser.
Solution: modify php. ini in the directory where php is located.
With the help of selo, a member of osuo network, I am told that I want to modify the php in the path where php is installed. ini (note: it must be php under the php path. ini) extension_dir = the path to install php extensions (for example, c: phpextensions ).
Problem 2: php_gd.dll does not support gif
I loaded the php_gd.dll dynamic connection Library dl ("php_gd.dll") at the beginning of the program. However, when running the program, the following result is displayed:
<Br> <B> Warning </B>: ImageGif: No GIF support in this PHP build in <B> d: apachehtdocsgif2.php3 </B> on line <B> 12 </B> <br>.
Solution: Use php4.05
At this time, I found that the problem in the book is that php_gd.dll does not support generating gif at all. It is only through the guidance of senior people that my version php4.04 for win32 lacks php_gd_gif.dll, so I downloaded a later version of php4.05, which supports generating dynamic gif php_gd_gif.dll.
Problem 3: Warning: Function registration failed-duplicate name-imagearc in d: apachehtdocsgif2.php3 on line 3
The procedure is as follows:
<?
Dl ("php_gd_gif.dll ");
Header ("content-type: image/gif ");
$ Im = imagecreate (400,30 );
$ Black = imagecolorallocate ($ im, 0, 0 );
$ White = imagecolorallocate ($ im, 255,255,255 );
Imageline ($ im, $ white );
Imagestring ($ im, 5, 4, 10, "This is a Gif", $ white );
Imagegif ($ im );
Imagedestroy ($ im );
?>
Solution: modify the program or php. ini
The dl () function is used to load the dll. If ";" is removed before the required dll in the php. Ini file, do not use this function.
If ";" Before extension = php_gd_gif.dll in The INI file is not included, dl ("php_gd_gif.dll") should be used for loading. In short, the two are different from each other, otherwise, the server considers the name to be repeated.