Solution to the problem that the PHP file image cannot be displayed
##Solution steps:
1. First, confirm whether the gd library is enabled
2. Go to the php.ini file, find extension=php_gd2.dll and remove the previous one
3. Retry Start the server.
If the normal image is still not displayed in the drawing, it means that the image information is incorrect when the server responds to the request. Make sure there is nothing in front of , including html code.
If the image is not displayed yet, clear the cache before drawing (that is, before writing the header), write ob_clean() first, and then it can be displayed (including when writing a file to download, after downloading) When the file cannot be opened, you also need to clear the cache).
Recommended tutorial:
PHP video tutorial
The above is the detailed content of PHP file image cannot be displayed. For more information, please follow other related articles on the PHP Chinese website!