Home  >  Article  >  Backend Development  >  PHP pictures cannot be displayed

PHP pictures cannot be displayed

王林
王林Original
2019-09-30 11:54:227404browse

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 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn