Beeta Posted January 19, 2023 Share Posted January 19, 2023 TB 1.4 bleeding edge (version fcf3987d011c85bb59dd7b75c9c75ef91b715036) PHP 7.2 I'm gettin this 500 error when I try to open the file manager to upload an image: Error Call to undefined function mime_content_type() in file /home/nginx/domains/domain.com/public/adminNNNNNN/filemanager/include/php_image_magician.php at line 1745 Source file: /home/nginx/domains/domain.com/public/adminNNNNNN/filemanager/include/php_image_magician.php 1726: } else { 1727: $alpha += 127 * $opacity; 1728: } 1729: $alphacolorxy = imagecolorallocatealpha($img, ($colorxy >> 16) & 0xFF, ($colorxy >> 8) & 0xFF, $colorxy & 0xFF, $alpha); 1730: imagesetpixel($img, $x, $y, $alphacolorxy); 1731: } 1732: } 1733: } 1734: 1735: /** 1736: * @param $file 1737: * @return false|GdImage|resource 1738: * @throws Exception 1739: */ 1740: private function openImage($file) 1741: { 1742: if (!file_exists($file) && !$this->checkStringStartsWith('http://', $file) && !$this->checkStringStartsWith('https://', $file)) { 1743: throw new Exception('Image not found.'); 1744: } 1745: $extension = mime_content_type($file); 1746: $extension = fix_strtolower($extension); 1747: $extension = str_replace('image/', '', $extension); 1748: switch ($extension) { 1749: case 'jpg': 1750: case 'jpeg': 1751: $img = @imagecreatefromjpeg($file); 1752: break; 1753: case 'webp': 1754: $img = @imagecreatefromwebp($file); 1755: break; Stack trace 1. adminNNNNNN/filemanager/include/php_image_magician.php:252 source imageLib->openImage(arguments) 2. adminNNNNNN/filemanager/include/utils.php:96 source imageLib->__construct(arguments) 3. adminNNNNNN/filemanager/dialog.php:972 source create_img_gd(arguments) PHP version: unknown. Code revision: unknown build for PHP unknown Link to comment Share on other sites More sharing options...
0 e-com Posted January 20, 2023 Share Posted January 20, 2023 Misconfigured server. No fileinfo extension for PHP installed. phpinfo(); 2 Link to comment Share on other sites More sharing options...
0 DRMasterChief Posted April 6 Share Posted April 6 same here with LiteSpeed Server and tb 1.5.x , activate the fileinfo php-extension was necessary, now the Filemanager works! Link to comment Share on other sites More sharing options...
Question
Beeta
TB 1.4 bleeding edge (version fcf3987d011c85bb59dd7b75c9c75ef91b715036)
PHP 7.2
I'm gettin this 500 error when I try to open the file manager to upload an image:
Error Call to undefined function mime_content_type() in file /home/nginx/domains/domain.com/public/adminNNNNNN/filemanager/include/php_image_magician.php at line 1745 Source file: /home/nginx/domains/domain.com/public/adminNNNNNN/filemanager/include/php_image_magician.php 1726: } else { 1727: $alpha += 127 * $opacity; 1728: } 1729: $alphacolorxy = imagecolorallocatealpha($img, ($colorxy >> 16) & 0xFF, ($colorxy >> 8) & 0xFF, $colorxy & 0xFF, $alpha); 1730: imagesetpixel($img, $x, $y, $alphacolorxy); 1731: } 1732: } 1733: } 1734: 1735: /** 1736: * @param $file 1737: * @return false|GdImage|resource 1738: * @throws Exception 1739: */ 1740: private function openImage($file) 1741: { 1742: if (!file_exists($file) && !$this->checkStringStartsWith('http://', $file) && !$this->checkStringStartsWith('https://', $file)) { 1743: throw new Exception('Image not found.'); 1744: } 1745: $extension = mime_content_type($file); 1746: $extension = fix_strtolower($extension); 1747: $extension = str_replace('image/', '', $extension); 1748: switch ($extension) { 1749: case 'jpg': 1750: case 'jpeg': 1751: $img = @imagecreatefromjpeg($file); 1752: break; 1753: case 'webp': 1754: $img = @imagecreatefromwebp($file); 1755: break; Stack trace 1. adminNNNNNN/filemanager/include/php_image_magician.php:252 source imageLib->openImage(arguments) 2. adminNNNNNN/filemanager/include/utils.php:96 source imageLib->__construct(arguments) 3. adminNNNNNN/filemanager/dialog.php:972 source create_img_gd(arguments) PHP version: unknown. Code revision: unknown build for PHP unknown
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now