PHP pictures cannot be displayed

王林
Release: 2023-02-25 17:30:01
Original
7425 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template