Title: Warning: Undefined array key &#8220;SERVER_NAME&#8221;
Last modified: July 14, 2022

---

# Warning: Undefined array key “SERVER_NAME”

 *  Resolved [terremoto1996](https://wordpress.org/support/users/terremoto1996/)
 * (@terremoto1996)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/)
 * Hi, when I updated Yoast seo to version 19.3 I start to get warnings
 *     ```
       ErrorException /wp-content/plugins/wordpress-seo/src/helpers/url-helper.php in Yoast\WP\SEO\Helpers\Url_Helper::recreate_current_url
       Warning: Undefined array key "SERVER_NAME"
       ```
   
 *  line 245
 * from the stack trace I was able to understand that the problem is generated when
   wordpress launches cron.
 * Before updating the yoast plugin this never happened to me.
 * To avoid these warnings, I delayed doing so
 * `$current_url .= (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '
   www.forap.it') . $suffix;`
 * I would like to know why yoast has this error now and if it affects seo, and 
   when this bug will be fixed
 * Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [jeroenvip](https://wordpress.org/support/users/hieronymusdesign/)
 * (@hieronymusdesign)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/#post-15826935)
 * What user is running the cronjob? We are also running some scripts inside wordpress
   not as www-data, which generates this error on the CLI.
 *  [Sotiris Katsaniotis](https://wordpress.org/support/users/sotiris_k/)
 * (@sotiris_k)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/#post-15827545)
 * I’d like to add that I’m also seeing the warning in my logs and it occurs when
   I run my cron jobs through WP-CLI. I have disabled wp-cron from wp-config. Also
   I’m running them as the files owner account, not as www-data.
 *  Thread Starter [terremoto1996](https://wordpress.org/support/users/terremoto1996/)
 * (@terremoto1996)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/#post-15827603)
 * that’s right, the problem is when the cron is started, but I can’t turn them 
   off I need it. Will this problem be solved with YOAST?
 *  [Sotiris Katsaniotis](https://wordpress.org/support/users/sotiris_k/)
 * (@sotiris_k)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/#post-15827618)
 * It makes sense that it’ll throw a warning for cron jobs through CLI because there’s
   no SERVER_NAME index for php-cli.
 *  Thread Starter [terremoto1996](https://wordpress.org/support/users/terremoto1996/)
 * (@terremoto1996)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/#post-15827624)
 * Of course! but understand I hate these alerts, they clog up the Sentry Log platform.
   I reiterate that these warnings started coming when I updated Yoast to the latest
   version, it didn’t happen before
 *  [jeroenvip](https://wordpress.org/support/users/hieronymusdesign/)
 * (@hieronymusdesign)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/#post-15830145)
 * [@sotiris_k](https://wordpress.org/support/users/sotiris_k/) You are correct.
   Wheb you run something inside the wordpress folder other then www-data SERVER_NAME
   is not set. Using nginx.
 *  Thread Starter [terremoto1996](https://wordpress.org/support/users/terremoto1996/)
 * (@terremoto1996)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/#post-15830372)
 * so what should I do?
 *  Plugin Support [Maybellyne](https://wordpress.org/support/users/maybellyne/)
 * (@maybellyne)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/#post-15834414)
 * Hello Everyone,
 * Thank you for bringing this issue to our attention. I’m sorry that our plugin
   caused a problem on your site. Our product team has created a bug report, and
   it is under review.
 * **Workaround**
    At this time, there is no known workaround.
 * **What’s next?**
    Our product team will assess the severity of the issue and 
   assign a priority level to the report. Our developers work on the highest priority
   issues first. We cannot give you an estimate of when they’ll start working on
   the issue.
 * If you have any further information that may affect the prioritization or help
   our development team solve this bug, please leave a comment or subscribe to the
   GitHub report to get updates on the issue.
 * [https://github.com/Yoast/wordpress-seo/issues/18688](https://github.com/Yoast/wordpress-seo/issues/18688)
 *  [devnihil](https://wordpress.org/support/users/devnihil/)
 * (@devnihil)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/#post-15865170)
 * We are going ahead and marking this issue as resolved due to inactivity. If you
   require any further assistance please create a new issue.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Warning: Undefined array key “SERVER_NAME”’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 9 replies
 * 5 participants
 * Last reply from: [devnihil](https://wordpress.org/support/users/devnihil/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-server_name/#post-15865170)
 * Status: resolved