Home > Article > Backend Development > php cannot load images
Solution to the problem that php cannot load images
Solution steps:
1. For php drawing, you must first confirm whether the gd library is enabled
2. Go to the php.ini file, find extension=php_gd2.dll and remove the previous;
3. Restart 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 any html code.
If the picture still does not appear, clear the cache before drawing (that is, before writing the header), first write ob_clean(); and then it can be displayed (including when writing a file to download, and the print after downloading appears. You also need to clear the cache when the file is not open).
Recommended tutorial: PHP video tutorial
The above is the detailed content of php cannot load images. For more information, please follow other related articles on the PHP Chinese website!