Title: Undefined index error SERVER_NAME
Last modified: July 30, 2018

---

# Undefined index error SERVER_NAME

 *  Resolved [GhostInTheMachines](https://wordpress.org/support/users/dekirs/)
 * (@dekirs)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/undefined-index-error-server_name/)
 * Problems with the Awesome Support Plugin.
 * There seems to be a problem in the functions-general.php file on line 198 where
   it references the Global variable SERVER_NAME.
 *  if ( empty( $post ) ) {
    $protocol = stripos( $_SERVER[‘SERVER_PROTOCOL’], ‘
   https’ ) === true ? ‘[https://&#8217](https://&#8217); : ‘[http://&#8217](http://&#8217);;
   $post_id = url_to_postid( $protocol . $_SERVER[‘SERVER_NAME’] . ‘:’ . $_SERVER[‘
   SERVER_PORT’] . $_SERVER[‘REQUEST_URI’] ); $post = get_post( $post_id ); }
 * complete error is:
    PHP Notice: Undefined index: SERVER_NAME in /my-webserver.
   domain/plugins/awesome-support/includes/functions-general.php on line 198
 * ******************************************************************************
   
   STEPS TO REPRODUCE ******************************************************************************
   Install and activate Awesome Support cd into your wp installation directory run
   wp-cli cache flush
 * RESULT
    error stated above

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

 *  Plugin Author [awesomesupport](https://wordpress.org/support/users/awesomesupport/)
 * (@awesomesupport)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/undefined-index-error-server_name/#post-10541867)
 * Hi:
 * We do not have any explicit support for wp-cli and don’t test the plugin with
   that utility during the release process. What happens if you try to clear the
   cache via the WP-ADMIN dashboard using a well-know cache plugin such as wp-rocket?
   Does the error still show up?
 * Thanks.
 *  Thread Starter [GhostInTheMachines](https://wordpress.org/support/users/dekirs/)
 * (@dekirs)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/undefined-index-error-server_name/#post-10541896)
 * Well its not just when you run the wp-cli cache flush command.
 * I first noticed the error when checking my PHP log.
 * The wp-cli cache flush command is just a good way to find buggy plugins that 
   do not check for null in their code, which is what this looks like.
 *  Plugin Author [awesomesupport](https://wordpress.org/support/users/awesomesupport/)
 * (@awesomesupport)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/undefined-index-error-server_name/#post-10541911)
 * Hi:
 * We’ll take it under advisement. The scenario you’re testing is not an officially
   supported one so of course you’re likely to encounter all kinds of issues (including
   null variables). If you can duplicate the issue with a supported use case (example:
   from the dashboard) we’ve love to understand how. But this particular use-case
   isn’t something we support right now.
 * Thanks very much.
 *  Thread Starter [GhostInTheMachines](https://wordpress.org/support/users/dekirs/)
 * (@dekirs)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/undefined-index-error-server_name/#post-10542110)
 * Host name: Digital Ocean
    plan: 1 gig of memory, 1cpu, 25gigs of disk space php
   version: 7.2.7 wp version: 4.9.7 mysql Ver 15.1 Distrib 10.2.16-MariaDB, for 
   debian-linux-gnu (x86_64) using readline 5.2 browsers: Firefox and Chrome from
   a Linux OS
 *  Plugin Author [awesomesupport](https://wordpress.org/support/users/awesomesupport/)
 * (@awesomesupport)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/undefined-index-error-server_name/#post-10542459)
 * Hi:
 * We spun up a 1 cpu, 25 GB droplet with WP over at digital ocean: [https://www.screencast.com/t/Gy4D2Ioxfn30](https://www.screencast.com/t/Gy4D2Ioxfn30)
 * We then turned on wordpress debug flags: [https://www.screencast.com/t/F31XoQZu1D](https://www.screencast.com/t/F31XoQZu1D)
 * Finally, we installed Awesome Support directly from the wordpress.org repository,
   checking for debug.log entries in the wp-content every step of the way. No debug.
   log file was creating during the installation.
    [⌊07.30.2018-23.08⌉](https://www.screencast.com/t/ohtbx17agXo)
 * Unfortunately, we weren’t able to replicate the issue you’ve encountered with
   a basic DO droplet.
 * Thanks.

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

The topic ‘Undefined index error SERVER_NAME’ is closed to new replies.

 * ![](https://ps.w.org/awesome-support/assets/icon-256x256.png?rev=1849681)
 * [Awesome Support - WordPress HelpDesk & Support Plugin](https://wordpress.org/plugins/awesome-support/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/awesome-support/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/awesome-support/)
 * [Active Topics](https://wordpress.org/support/plugin/awesome-support/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/awesome-support/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/awesome-support/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [awesomesupport](https://wordpress.org/support/users/awesomesupport/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/undefined-index-error-server_name/#post-10542459)
 * Status: resolved