Php does not specify to output only html files. it can be a daily gif file. I encountered some titles when applying php dynamic gif images. now I am using php4.05 (forwin32) + apache3.1.2 _ win32. Title 1: Basic programs for dynamic native gif
Php does not specify to output only html files. it can be a daily gif file. I encountered some titles when applying php dynamic gif images. now I am using php4.05 (for win32) apache3.1.2 _ win32.
Title 1: dynamically born gif programs cannot be converted
I wrote an example about how to use a native gif in php. when I run it, the invention page cannot be flushed out, just as if I had died, 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 was told to correct the php in the path where php is installed. ini (note: it must be php under the php path. ini) extension_dir = path to install php \ extensions (for example, c: \ php \ extensions ).
Title 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 results were displayed:
Warning: ImageGif: No GIF support in this PHP build inD: \ apache \ htdocs \ gif2.php3On line12
.
Solution: application php4.05
At this time, I discovered that the title php_gd.dll in the book basically cannot support native gif. only by the guidance of senior people can I know that my php4.04 for win32 version lacks php_gd_gif.dll, so I downloaded a later version of php4.05, which contains the php_gd_gif.dll supporting the daily lively gif.
Title 3: Warning: Function registration failed-duplicate name-imagearc in d: \ apache \ htdocs \ gif2.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, but if the ";" in front of the required dll has been dropped in the php. ini file, do not apply this function.
If the ";" Before extension = php_gd_gif.dll in The INI file is not in the same direction, 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.