Many things break after upgrading from PHP 7.3

Upgrading our MODX 2.8.4 PHP version to anything higher than 7.3 breaks pthumb, migx, MODXminify, Content Blocks cropping tool and the ability to upload files. Reverting back to 7.3 fixes everything. Any suggestions?

Cropping Tool Errors:
Screen Shot 2022-09-23 at 6.41.25 PM

[2022-09-23 18:15:37] (ERROR @ /home/atom/public_html/core/components/contentblocks/model/contentblocks/contentblocks.class.php : 1373) [ContentBlocks] Can't use the ExifMetaDataReader to automatically rotate images: The PHP EXIF extension is required to use the ExifMetadataReader

MODXMinify Errors:

[2022-09-23 18:47:26] (ERROR @ /home/atom/public_html/core/components/modxminify/model/modxminify/modxminify.class.php : 186) PHP warning: Undefined variable $skip
[2022-09-23 18:47:26] (ERROR @ /home/atom/public_html/core/components/modxminify/assetic/vendor/leafo/scssphp/src/Compiler.php : 3705) PHP warning: Trying to access array offset on value of type null

pthumb errors:

[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$cache_source_enabled
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$cache_source_directory
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$allow_local_http_src
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$cache_directory_depth
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 3664) PHP warning: filemtime(): stat failed for /client_media/images/stock/pawel-czerwinski-NTYYL9Eb9y8-unsplash.jpg
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$cache_source_enabled
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$cache_source_directory
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$allow_local_http_src
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$cache_directory_depth
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 3664) PHP warning: filemtime(): stat failed for /client_media/images/stock/pawel-czerwinski-6lQDFGOB1iw-unsplash.jpg
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$cache_source_enabled
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$cache_source_directory
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$allow_local_http_src
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 338) PHP warning: Undefined property: modPhpThumb::$cache_directory_depth
[2022-09-23 18:47:27] (ERROR @ /home/atom/public_html/core/model/phpthumb/phpthumb.class.php : 3664) PHP warning: filemtime(): stat failed for /client_media/images/stock/usgs-hoS3dzgpHzw-unsplash.jpg
[2022-09-23 18:47:28] (ERROR @ /home/atom/public_html/core/xpdo/xpdo.class.php : 2855) PHP warning: Array to string conversion

Most of these “errors” are just “PHP warnings” that shouldn’t break the site.

Maybe you have to change the values for error_reporting or display_errors on the server. Sometimes if an “error” is output to the response in an AJAX-request, it can mess up the expected response-format.
Maybe also check the system setting debug in MODX.

That ContentBlocks error means the exif extension isn’t enabled on the new PHP version. I’d recommend enabling that to make sure it can parse that and fix rotated images.

@halftrainedharry Updating the Debug system setting to 0 did seem to fix some of the issues. Who knew?

@markh I’ve installed the exif thing and that did indeed fix that issue.

One larger remaining issue is the modx file upload pops up an blank error upon successful file upload.
Screen Shot 2022-09-27 at 1.39.05 PM

and there’s a thumbnail caching issue in the error log that looks new

Can you inspect the AJAX request for the upload in the browsers’ developer console and see what the response to that is? There’ll be a request to connectors/index.php when you click on upload.

Also check your server error logs.

Just the always fun 500 error…

Screen Shot 2022-09-28 at 9.13.14 AM

Anything in the response tab for that request? Server error log?

The response tab says there is no data available and there’s nothing new in the error log.

To be clear, the files are successfully uploaded even with the error popup

@shoutouttorob for these types of Ajax 500 server errors I typically turn on all error reporting (through ini or updating the index.php) try the action again that caused the error (in your case upload a file) then turn off error reporting. In the network tab of your console in the response tab you’ll see the stack trace of the error that was thrown. Usually helps me figure out what to do next.

Word of warning, best not to do this on a production site as turning on all php error reporting is a security risk. But needs must sometimes.