Title: PHP Notice: Undefined index: HTTP_HOST from wp cli
Last modified: February 7, 2017

---

# PHP Notice: Undefined index: HTTP_HOST from wp cli

 *  Resolved [Alexey](https://wordpress.org/support/users/asel/)
 * (@asel)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/php-notice-undefined-index-http_host-from-wp-cli/)
 * When running some comand from wp cli ([http://wp-cli.org](http://wp-cli.org))
 * `wp plugin list` for example
 * You get this:
    PHP Notice: Undefined index: HTTP_HOST in wp-content/plugins/wp-
   super-cache/wp-cache-base.php on line 4
 * To fix it wrap that line with
 *     ```
       if (php_sapi_name() != 'cli') {
       }
       ```
   
 * Fix in next release please

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

 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/php-notice-undefined-index-http_host-from-wp-cli/#post-8776789)
 * Thanks, I wrapped it in an isset() and disabled caching too because that value
   is used in the cache key as it would never be used by a web visitor.
 *  [daleharrison](https://wordpress.org/support/users/daleharrison/)
 * (@daleharrison)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/php-notice-undefined-index-http_host-from-wp-cli/#post-9078649)
 * Hello, I just encountered this issue as well and I’m glad to see it’s being addressed.
   Can you give us any idea when the plugin will be updated with this fix?

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

The topic ‘PHP Notice: Undefined index: HTTP_HOST from wp cli’ is closed to new 
replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [daleharrison](https://wordpress.org/support/users/daleharrison/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/php-notice-undefined-index-http_host-from-wp-cli/#post-9078649)
 * Status: resolved