PHP 8.x errors with Modx 3.0.4

I have modx 3.0.4 installed on Skytoaster hosting with php 7.4. Image thumbnails are not showing in the media manager or in the file list.

I searched the forum and found entries that say upgrading php to 8.x will fix this problem. However, when I do this Modx starts failing. The manager loads fine, but if I try to edit a resource I get a big red box that is filled with errors.

I tried every version of php 8.x, clearing the cache manually, etc. no change. When I revert back to 7.4 all is good except for the thumbnails.

Here’s what I see in the manager when I try to edit a resource.

Error: Class "finfo" not found

**Errors:**

* /home/xxxxxxx/public_html/core/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php:48
* League\Flysystem\Local\LocalFilesystemAdapter->__construct() in /home/xxxxxxx/public_html/core/src/Revolution/Sources/modFileMediaSource.php:52
* MODX\Revolution\Sources\modFileMediaSource->initialize() in /home/xxxxxxx/public_html/core/src/Revolution/modElement.php:995
* MODX\Revolution\modElement->setSource() in /home/xxxxxxx/public_html/core/src/Revolution/modElement.php:981
* MODX\Revolution\modElement->getSource() in /home/xxxxxxx/public_html/core/src/Revolution/Processors/Element/TemplateVar/Renders/mgr/input/file.class.php:29
* modTemplateVarInputRenderFile->process() in /home/xxxxxxx/public_html/core/src/Revolution/modTemplateVarRender.php:72
* MODX\Revolution\modTemplateVarRender->render() in /home/xxxxxxx/public_html/core/src/Revolution/modTemplateVarInputRender.php:26

The error log also has errors. Mostly with list of these errors:

/home/xxxxxxxx/public_html/core/src/Revolution/modManagerResponse.php 160
PHP warning: Undefined array key “args”

Could you check what PHP extensions are enabled on your PHP8.x versions?

MODX requires a few to be enabled to work properly.

PS - the extension fileinfo may also be required.

1 Like

You can fix the thumbnail issue in PHP 7.4 by deleting the word mixed in one code file as described here:

Might be easier than trying to make PHP 8 work.

1 Like

dejaya

I most of those required extensions were enabled, so I enabled the remaining, but no change.

halftrainedharry

I may resort to that fix for the thumbnails, but it I’m more concerned about php 8 not working. At some point we’ll need to upgrade from 7.4

Like @dejaya said, you seem to miss the fileinfo extension.

1 Like

So it was enabled for 7.4, but when I switched to 8.1 it was not enabled. I just didn’t notice that. Once I enabled that, we’re good to go.

AND the image thumbnails are working.

Woo hoo!

As always, thank you!

2 Likes

Glad you’re sorted! :+1: