This topic has 11 replies, 2 voices, and was last updated 2 years, 3 months ago ago by Rose Tyler
Hello,
We are having repeated fatal errors on our site when we activate php v8.0. A couple of examples are included below.
Because our site is live, we are unable to deactivate plugins to test, and can’t discover directly how to trigger the error. But, we do know if we roll back to php v7.4, the errors do not occur.
Can you recognize from the stack trace what might be causing this, and is this a known issue???
Is Xstore theme tested against php v8.0???
Your assistance would be greatly appreciated!
Ben
2022-09-17T02:53:47+00:00 CRITICAL Uncaught TypeError: strstr(): Argument #1 ($haystack) must be of type string, WP_Error given in /nas/content/live/borregooutfitt/wp-includes/functions.php:1143
Stack trace:
#0 /nas/content/live/borregooutfitt/wp-includes/functions.php(1143): strstr(Object(WP_Error), ‘#’)
#1 /nas/content/live/borregooutfitt/wp-includes/functions.php(1212): add_query_arg(‘view_mode’, false, Object(WP_Error))
#2 /nas/content/live/borregooutfitt/wp-content/themes/xstore/framework/woo.php(2423): remove_query_arg(‘view_mode’, Object(WP_Error))
#3 /nas/content/live/borregooutfitt/wp-includes/class-wp-hook.php(307): etheme_grid_list_switcher(”)
#4 /nas/content/live/borregooutfitt/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
#5 /nas/content/live/borregooutfitt/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
#6 /nas/content/live/borregooutfitt/wp-content/themes/xstore/woocommerce/archive-product.php(89): do_action(‘woocommerce_bef…’)
#7 /nas/content/live/borregooutfitt/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include(‘/nas/content/li…’)
#8 /nas/content/live/borregooutfitt/wp-content/plugins/woocommerce/templates/taxonomy-product-cat.php(22): wc_get_template(‘archive-product…’)
#9 /nas/content/live/borregooutfitt/wp-includes/template-loader.php(106): include(‘/nas/content/li…’)
#10 /nas/content/live/borregooutfitt/wp-blog-header.php(19): require_once(‘/nas/content/li…’)
#11 /nas/content/live/borregooutfitt/index.php(17): require(‘/nas/content/li…’)
#12 {main}
thrown in /nas/content/live/borregooutfitt/wp-includes/functions.php on line 1143
2022-09-17T03:48:32+00:00 CRITICAL Uncaught TypeError: strstr(): Argument #1 ($haystack) must be of type string, WP_Error given in /nas/content/live/borregooutfitt/wp-includes/functions.php:1143
Stack trace:
#0 /nas/content/live/borregooutfitt/wp-includes/functions.php(1143): strstr(Object(WP_Error), ‘#’)
#1 /nas/content/live/borregooutfitt/wp-includes/functions.php(1212): add_query_arg(‘view_mode’, false, Object(WP_Error))
#2 /nas/content/live/borregooutfitt/wp-content/themes/xstore/framework/woo.php(2423): remove_query_arg(‘view_mode’, Object(WP_Error))
#3 /nas/content/live/borregooutfitt/wp-includes/class-wp-hook.php(307): etheme_grid_list_switcher(”)
#4 /nas/content/live/borregooutfitt/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
#5 /nas/content/live/borregooutfitt/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
#6 /nas/content/live/borregooutfitt/wp-content/themes/xstore/woocommerce/archive-product.php(89): do_action(‘woocommerce_bef…’)
#7 /nas/content/live/borregooutfitt/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include(‘/nas/content/li…’)
#8 /nas/content/live/borregooutfitt/wp-content/plugins/woocommerce/templates/taxonomy-product-cat.php(22): wc_get_template(‘archive-product…’)
#9 /nas/content/live/borregooutfitt/wp-includes/template-loader.php(106): include(‘/nas/content/li…’)
#10 /nas/content/live/borregooutfitt/wp-blog-header.php(19): require_once(‘/nas/content/li…’)
#11 /nas/content/live/borregooutfitt/index.php(17): require(‘/nas/content/li…’)
#12 {main}
thrown in /nas/content/live/borregooutfitt/wp-includes/functions.php on line 1143
Hello,
Provide URL of the page with the error + temporary wp-admin and FTP access.
Regards
Hello Rose,
Credentials provided in private area.
Unfortunately, I cannot provide a particular URL on the site which causes this error to occur. It seems to occur somewhat at random. If you look at our error log, you can see these errors are occurring multiple times over a 12 hour period.
If we revert back to php 7.4, then the site runs error free.
I thought that by looking at the error stack trace, you might recognize where the error is coming from.
Please advise.
Thank you for your assistance.
Ben
Hello @Bnourse,
Thank you for the fast reply.
Please check FTP access, because we can’t connect. What post should we use? Is there a restriction by ip or something else?
Regards
I’m sorry, see private area for port number.
I just connected without problem, shouldn’t be any restrictions.
Let me know if still having problem connecting.
I notice you added code to the child theme functions.php.
I had moved that code to snippets plugin, but I have turned that snippet off for the time being while you test.
Ben
Your child-theme looks a bit miconfigured -> https://prnt.sc/UZ_mojr3Un4v
We corrected it for you and added few lines fix which may help in your case -> https://prnt.sc/yyKRmqzLXnaw
Please, check for some time if the issue still persists
Regards
As I said, I had moved that code from the child theme to a snippet. But, that snippet is now deactivated and I will leave the child theme as you have it.
I will watch to see if the errors continue, and will let you know.
Wondering about the additional code, doesn’t it just redirect to the homepage if an error occurs?
Thanks for helping.
Ok, we got you !
‘Wondering about the additional code, doesn’t it just redirect to the homepage if an error occurs?’ = yes, but we don’t know exactly when the issue starts so it requires some time to understand when it is and where. if you will have any ready results of testing/checking, write us and we will dig deeper inside the problem with provided details from your side.
Regards
Good morning,
I can report that with the redirect code in place, the fatal errors are not appearing in the log…
Wondering if that redirect snippet could be changed to actually report the URL where the errors occur in a log???
Thank you for helping track this down. We are really wanting to run the site on php 8.0, and our hosting provider wpengine is encouraging this, since they may discontinue php 7.4 support sometime soon.
Hello,
It is nice to hear that our tweak helped you in your specific case.
‘Wondering if that redirect snippet could be changed to actually report the URL where the errors occur in a log???’ = no it is not possible, but you may remove it and check again = it will show you errors which you had in the first message you described but without any details more. You may also try to remove the snippet and check one by one plugins you have.
Truly saying that error shows randomly so you will not be able to find the real reason (or real plugin which created such thing) quickly.
We would recommend you to keep that snippet enabled because it won’t make any issues for you but only helps in some cases which cannot be found.
Regards
Tagged: fatal errors, known issue, php 8.0, templates, woocommerce, wordpress, xstore
You must be logged in to reply to this topic.Log in/Sign up