This article introduces the reasons and solutions for the inability to display pictures when PHP uses the gd library to draw. Friends in need can refer to it.
For PHP drawing, you must confirm whether the gd library is enabled. Go to the php.ini file, find extension=php_gd2.dll, remove the previous;, and restart the server. If the normal picture is still not displayed in the drawing, it means that the image information is incorrect when the server responds to the request. Make sure there is no anything in front of it, including html. If the picture is not produced yet, clear the cache before drawing (that is, before writing the header), write ob_clean() first; Then the picture can be displayed (including when writing a file to download, if the file cannot be opened after downloading, the cache can be cleared). Example of php GD library generating thumbnails Basic knowledge of php gd library Detailed explanation of the usage of GD function in PHP GD library php GD library generates high-quality thumbnails (example) php gd library implements remote image download Usage of php GD library function getimagesize() php opens GD library (windows environment) Example code for drawing 24-hour histogram using php GD library How to install php GD support library under Linux Introduction to how to enable gd2 extension in php Example of php verification code (GD library generates verification code) Solution to Chinese garbled characters in php GD library Example of php GD library generating verification code php GD library code to upload images and create thumbnails |