PHP notice since new release 19.3
-
Hi!
Since new release :
PHP Notice: Undefined index: SERVER_NAME in /home/xxxxxx/domains/monsite.fr/public_html/wp-content/plugins/wordpress-seo/src/helpers/url-helper.php on line 245Thanks for your help
Eric
-
Sorry to hear that you’re seeing an error in the latest version of Yoast SEO. We are already into this but having a hard time reproducing it. Can you please share a bit more information on how can we reproduce the error on our end? Where do you see the relevant notice? Is there a specific page that we can take a look at? When exactly does the error occur?
Ok, i just discovered the logs so I don’t have much info.
On the other hand, what is certain is that this error appears every 5 minutes (cron?):
[12-Jul-2022 16:15:03 UTC] PHP Notice: Undefined index: SERVER_NAME in /xxxxxxx/wp-content/plugins/wordpress-seo/src/helpers/url-helper.php on line 245
[12-Jul-2022 16:20:02 UTC] PHP Notice: Undefined index: SERVER_NAME in /xxxxxxx/wp-content/plugins/wordpress-seo/src/helpers/url-helper.php on line 245
[12-Jul-2022 16:25:01 UTC] PHP Notice: Undefined index: SERVER_NAME in /xxxxxxx/wp-content/plugins/wordpress-seo/src/helpers/url-helper.php on line 245
[12-Jul-2022 16:30:02 UTC] PHP Notice: Undefined index: SERVER_NAME in /xxxxxxx/wp-content/plugins/wordpress-seo/src/helpers/url-helper.php on line 245Maybe that can put you on a track?
On my site I have no cron every 5 minutes`I confirm this.
I am running wp-cron through an actual cron job, so it is command line PHP ( 8.0.20).
My site is hosted in Digital Ocean in a droplet running Ubuntu 20.04.4 LTS.
Because my cron job runs every minute, i was showered with notifications…
So, i mitigated this by replacing the offending line with
$current_url .= ( isset( $_SERVER['SERVER_NAME'] ) ? $_SERVER['SERVER_NAME'] : '' ) . $suffix;, as to affect as little code as possible.Further confirmation: i am getting this exact same problem on a distinct site, on a completely different server (Fastcomet, shared hosting, cPanel 102.0).
Here, wp-cron does still run through a system cron job, with CLI PHP (PHP 8.0.21).
The error log is getting filled up with messages like this one:
[14-Jul-2022 06:22:02 UTC] PHP Warning: Undefined array key "SERVER_NAME" in /home/{{redacted for privacy}}/wp-content/plugins/wordpress-seo/src/helpers/url-helper.php on line 245Came across this thread while looking for a solution to this issue.
I am having the same error, but for me it is when I am using the WP CLI to run
wp search-replaceThe error I’m getting In
url-helper.php line 245: Undefined index: SERVER_NAMEYes I can confirm, I’m having the same issue with version version 19.3 which breaks my WP-CLI. Downgrading to version 19.2 fixes the issue for now.
In url-helper.php line 245: Undefined array key "SERVER_NAME"Thanks for sharing all the information everyone. I just want to let you know that we were able to reproduce the issue and is currently being investigated further. It’s an unfortunate regression in the latest version that’s showing the relevant error in the server error log but that will not impact anything negatively in terms of SEO on your website.
That said, we have already opened a bug report internally for further investigation. In the meantime, please keep your discussion running on the relevant GitHub issue since the development team is far more active there. You can find the relevant GitHub issue here: https://github.com/Yoast/wordpress-seo/issues/18688
The topic ‘PHP notice since new release 19.3’ is closed to new replies.