Issue background:
Offline Phpcms Project No problem, the online phpcms newly added picture thumbnail shows a problem, check the PHP version, the offline is 5.5, the line is 5.1
Cause of the problem:
Looked at the error log on the line, showing:
PHP Fatal Error: Call to undefined function image_type_to_extension ()
Search found Image_type_to_extension This method is php5.2 later.
Workaround:
1. Upgrade PHP to 5.2 or later
2. Modify the source code, add judgment statement
-Open './phpcms/libs/classes/image.class.php ' line 37th
-Find
$imagetype Strtolower (substr(image_type_to_extension ($imageinfo[2]), 1));
Replace it with a
if (function_exists(image_type_to_extension)) { $imagetypestrtolower( Substr(image_type_to_extension ($imageinfo[2]), 1)); }Else{ $imagetypestrtolower(substr($img ,strrpos($img, '. ') +1)); }
Phpcms cannot display thumbnails call to undefined function image_type_to_extension