And you didn't upgrade cakephp/php ? Cause that looks like an incompatible method call, where you don't use a parameter where the (new) afterRender expects a $viewFile parameter.
If you could provide the changes that have been made in the php's ini file that would be helpful.