After upgrading to EE 4 & PHP 7, when uploading a new image to the server in an entry, the upload fails and I get the following PHP error:
Fatal error: Uncaught Error: Call to undefined function EllisLab\ExpressionEngine\Library\Mime\finfo_open() in /home/ihist/public_html/sketch/ee/EllisLab/ExpressionEngine/Library/Mime/MimeType.php:104 Stack trace:
#0 /home/ihist/public_html/sketch/ee/legacy/libraries/Mime_type.php(93): EllisLab\ExpressionEngine\Library\Mime\MimeType->ofFile('/tmp/phpsJV2ii')
#1 /home/ihist/public_html/sketch/ee/legacy/libraries/Upload.php(167): Mime_type->ofFile('/tmp/phpsJV2ii')
#2 /home/ihist/public_html/sketch/ee/legacy/libraries/Filemanager.php(1889): EE_Upload->do_upload('file')
#3 /home/ihist/public_html/sketch/ee/legacy/libraries/Filemanager.php(1023): Filemanager->_upload_file(Array, 'file')
#4 /home/ihist/public_html/sketch/ee/EllisLab/ExpressionEngine/Service/File/Upload.php(298): Filemanager->upload_file('1', 'file')
#5 /home/ihist/public_html/sketch/ee/EllisLab/ExpressionEngine/Controller/Files/Files.php(137): EllisLab\ExpressionEngine\Service\File\Upload->uploadTo('1')
#6 [internal function]: EllisLab\ExpressionEngine\Control in /home/ihist/public_html/sketch/ee/EllisLab/ExpressionEngine/Library/Mime/MimeType.php on line 104
The last line leads me to believe it's an issue with the PHP fileinfo module, which I have enabled in my php.ini file with the following line:
extension = fileinfo.so
After that, I restarted Apache, but still no dice. This is eerily similar to this post but I haven't had any luck. It's also pretty similar to this post but I can confirm GD is enabled!
It looks like file info is also installed by default with the following line:
'--enable-fileinfo=shared'
Some more details about my environment:
- EE 4.3.6
- PHP 7.0.33
- Apache 2.4.38 running linux
Notes:
- This error also occurs when syncing the file directory
- This error also occurs when uploading other file types besides .jpg, like .png