Home > Article > Backend Development > PHP pictures cannot be displayed
Solution to the problem that pictures are not displayed in PHP drawing
1. For PHP drawing, you need to confirm whether the gd library is enabled
Go to the php.ini file, find extension=php_gd2.dll
, remove the previous comment symbol, and restart the server.
2. 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 not to place it in the php?>Do not put anything in front, including html code.
3. If the picture still does not appear, clear the cache before drawing (that is, before writing the header).
Write the ob_clean() function first, and then It can be displayed (including when writing a file to download, if the file cannot be opened after downloading, you also need to clear the cache).
Recommended tutorial: PHP video tutorial
The above is the detailed content of PHP pictures cannot be displayed. For more information, please follow other related articles on the PHP Chinese website!