new topic occur error on PHP8
-
Hi
upgrade to wordpress 5.6.1 and php 8.0.2
I wrote a new topic
When writing is completed, the following abnormal screen is displayed.ref img1 : https://ibb.co/DbDR2vT
ref img2 : https://ibb.co/M53Lwgb
Seriously, nothing is left in nginx’s error log.
Nothing is left in the error log of php-fpm.The topics created before the upgrade can be read normally.
This problem arises from topics created after the upgrade.
i need to help
Best Regards,
Hyunho
-
works fine on my test site – I can only suggest it could be a theme or plugin issue
Themes
As a test switch to a default theme such as twentytwenty, and see if this fixes.
Plugins
If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users
Then come back
Hello again?
@robin-wI thought of this problem as “bbp style pack”
Because when a problem occurs, the error is “bbp style pack” error.
this support linkI just updated the bbp style pack, but bbpress still problems
I don’t think it’s a “bbp style pack” problem
(Because no error occurs after update)I’m worried because no error occurred
First, I’ll try to disable the plugin one by one according to your guide and test it.I will also install the “Health Check & Troubleshooting” plugin.
Thanks
Best Regards,
Hyunhook, come back when you have done so
hi @robin-w
i found problem root cause
“bbPress Simple View Counts” was the problem.
“Health Check & Troubleshooting” This plugin is very useful
Troubleshooting Mode is very good And a log was also left.### Nginx Log 2021/02/18 00:35:57 [error] 13752#13752: *888 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Unsupported operand types: string + int in /source/wp-content/plugins/bbpress-simple-view-counts/bbpress-simple-view-counts.php:95 Stack trace: #0 /source/wp-includes/class-wp-hook.php(289): bbpress_simple_view_counts->show_views_topic_page() #1 /source/wp-includes/plugin.php(212): WP_Hook->apply_filters() #2 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3348): apply_filters() #3 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3278): bbp_get_single_topic_description() #4 /source/wp-content/plugins/bbpress.new/templates/default/bbpress/content-single-topic.php(33): bbp_single_topic_description() #5 /source/wp-includes/template.php(732): require('/source...') #6 /source/wp-content/plugins/bbpress.new/includes/core/template-functions.php(103): load_template() #7 /source/wp-conten" while reading response header from upstream, client: 192.168.0.1, server: fedora.h2code.cf, request: "GET /forums/topic/23118 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php-fpm.sock:", host: "site.name" ### PHP-FPM Log [pool www] child 13731 said into stderr: "NOTICE: sapi_cgi_log_message(), line 611: PHP message: PHP Fatal error: Uncaught TypeError: Unsupported operand types: string + int in /source/wp-content/plugins/bbpress-simple-view-counts/bbpress-simple-view-counts.php:95" [pool www] child 13731 said into stderr: "Stack trace:" [pool www] child 13731 said into stderr: "#0 /source/wp-includes/class-wp-hook.php(289): bbpress_simple_view_counts->show_views_topic_page()" [pool www] child 13731 said into stderr: "#1 /source/wp-includes/plugin.php(212): WP_Hook->apply_filters()" [pool www] child 13731 said into stderr: "#2 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3348): apply_filters()" [pool www] child 13731 said into stderr: "#3 /source/wp-content/plugins/bbpress.new/includes/topics/template.php(3278): bbp_get_single_topic_description()" [pool www] child 13731 said into stderr: "#4 /source/wp-content/plugins/bbpress.new/templates/default/bbpress/content-single-topic.php(33): bbp_single_topic_description()" [pool www] child 13731 said into stderr: "#5 /source/wp-includes/template.php(732): require('/source...')" [pool www] child 13731 said into stderr: "#6 /source/wp-content/plugins/bbpress.new/includes/core/template-functions.php(103): load_template()" [pool www] child 13731 said into stderr: "#7 /source/wp-conten..."
“bbPress Simple View Counts” This plugin is out of date.
I’ll try to disable it and think more about what to do.Thank you again
Best Regards,
Hyunho“Health Check & Troubleshooting” This plugin is very useful
yes, I only found that plugin a few months ago – it is good 🙂
given that the simple counts plugin is not being maintained, there seems no reason why you should not just alter it.
The problem is that it is seeing the value retrieved from the database as a string, so we need to convert it to an integer
so try changing line 94
from
$hitCount = get_post_meta($post_id, 'bbp_svc_viewcounts', true)
;to
$hitCount = int (get_post_meta($post_id, 'bbp_svc_viewcounts', true));
Hi~!
Thanks for the guide
I tried to fix it because it didn’t work
I finally solved the problem through your idea(int)$hitCount = get_post_meta($post_id, 'bbp_svc_viewcounts', true); (int)$hitCount = (int)$hitCount + 1;
hahahah , integer hard cording
problem clear ^^;;;
Best Regards,
Hyunho$hitCount = (int)$hitCount + 1;
When I check again, I think I can only correct that part
Thanks~!
no problem – php 8 is a lot tougher on getting the syntax right!
- You must be logged in to reply to this topic.