Install Config Wiki

All about installing, configuring and troubleshooting

User Tools

Site Tools


type_error_thrown_call_user_function_array

Windows Server 2019 with IIS 10, mod-rewrite and the following PHP Versions installed.

The Website was initially using WordPress 6.0 and Twenty-Fourteen theme (having a child theme that enqueues a customer style.css add-in file that centers the theme's outer container, so that this left-justified theme is now center-justified on-screen).

An instance of PHP 7.2.19 was Installed as the default PHP version for all websites on IIS, and I had Mapped the Module Fast-CGI.exe script of the PHP 7.2.19 instance with WordPress 6.0 and Twenty-Fourteen theme.

When I tried to Install and Enable an instance of PHP 8.1.12, the website displayed the following error:

TypeError thrown call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method AKTT::controller() cannot be called statically

This error occurs when I try to change from PHP 7.2.19 to PHP 8.1.12 while using WordPress Version 6.0 and PHP Version 8.1.12 with Theme Twenty-Fourteen.

The website and the backend were not viewable.

I reverted the mapped fast_cgi.exe module (and Web.Config file) back to PHP 7.2.19 fast_cgi.exe and the website returned to normal display.

I then installed and instance PHP 7.4 on the server and added fast-CGI module using PHP 7.4 Fast_CGI Executable in the same WordPress version 6.0 Site (which updated the Web.Config file to use PHP 7.4 fast-CGI script). The website using Twenty=Fourteen Theme continued to work normally on the front and back end.

Then, I tried to update from Twenty-Fourteen Site from WordPress 6.0 to WordPress 6.1 and got a different fatal error during the automatic update.

The website shows a blank white page with the following fatal error after update to wp 6.1

fatal error: function wp_get_attachment_thumb_file( $post_id = 0 )

On further investigation, the php_errors.log for the PHP 7.4 instance contained the following error entry:

[21-Jan-2023 22:02:13 UTC] PHP Fatal error: Cannot redeclare wp_get_attachment_thumb_file() (previously declared in C:\hostingdata\site_user\public_html\site_domain_com\wp-includes\post.php:6709) in C:\hostingdata\site_user\public_html\site_domain_com\wp-includes\deprecated.php on line 4327

Note that line 6709 in post.php file and line 4327 in deprecated.php file both contain the same function wp_get_attachment_thumb_file($post_id = 0)

I was not about to edit the functions or delete anything. So, I manually reinstalled WordPress 6.0, and the site came back online using the PHP 7.4 instance.

type_error_thrown_call_user_function_array.txt · Last modified: 2023/01/22 22:24 by wikiadmin