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