Firstly I know we shouldn’t be using PHP5.x, so let’s just leave that at the door for a moment.
I recently upgraded to modx 2.8.6 and found that for some reason, some resources were throwing an error 500. The modx system error log offered nothing at all (no errors written to the log) which I thought was odd.
I did some digging and finally came across some entries in my httpd error log which offered some clues. It was coming up with
PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in /path/to/site/core/model/phpthumb/phpthumb.class.php on line 317
Looking in that file, there’s
public function __set(string $name, mixed $value): void {
}
I found if you change it to the below, that does the trick
public function __set(string $name, mixed $value) {
}
I hope someone finds this useful but you aren’t completely out of the woods because it’s still throwing these errors:
[2023-11-15 13:28:29] (ERROR @ /path/to/site/core/model/phpthumb/phpthumb.class.php : 317) Recoverable error: Argument 1 passed to phpthumb::__set() must be an instance of string, string given
[2023-11-15 13:28:29] (ERROR @ /path/to/site/core/model/phpthumb/phpthumb.class.php : 317) Recoverable error: Argument 2 passed to phpthumb::__set() must be an instance of mixed, boolean given
According to W3techs, ~20% of websites running PHP still uses PHP5. That’s going to be millions of sites in reality so suggest that this package is fixed for backwards compatibility in the next update.