Home > Backend Development > PHP Problem > What should I do if the image downloaded by php cannot be displayed?

What should I do if the image downloaded by php cannot be displayed?

藏色散人
Release: 2023-03-03 12:14:01
Original
2312 people have browsed it

The solution to the problem that php downloaded images cannot be displayed: first find and open the corresponding PHP code file; then find the imagepng function part; then add the "ob_clean()" function in front of the imagepng function; finally save the modification file.

What should I do if the image downloaded by php cannot be displayed?

Recommended: "PHP Tutorial"

imagepng cannot display images

It turns out to be php5 Apache2 WinSrv2003, everything is normal. After transplanting to the "PHP5.4 IIS7 WINSRV2008" environment, the picture has not been displayed, only the red cross.

The final solution is: after adding the ob_clean() function before the imagepng() function, the problem disappears.

The specific reasons have not yet been studied in depth, and discussions are welcome.

The above is the detailed content of What should I do if the image downloaded by php cannot be displayed?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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