This is an old revision of the document!
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 are not viewable.
I changed the mapped module (and Web.Config file) back to PHP 7.2.19 and the site returned to normal.
I then installed PHP 7.4 on the server and added fast-CGI module using PHP 7.4 Fast_CGI Executable in the WordPress 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 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.