Title: PHP warning
Last modified: February 23, 2023

---

# PHP warning

 *  Resolved [thartl](https://wordpress.org/support/users/hartl/)
 * (@hartl)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-410/)
 * Hello, I have been noticing php warnings on local and staging sites, and now 
   also when running WP CLI commands.
 * It’s just a warning, but I thought I’d mention it.
 * “Warning: Undefined array key “HTTP_HOST” in /wp-content/plugins/wp-cloudflare-
   page-cache/libs/html_cache.class.php on line 79″

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

 *  Plugin Contributor [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-410/#post-16501739)
 * Hi [@hartl](https://wordpress.org/support/users/hartl/),
   Please contact your 
   host and ask them why `$_SERVER['HTTP_HOST']` is not returning a value. It is
   supposed to as it is a global server variable.
 *  Thread Starter [thartl](https://wordpress.org/support/users/hartl/)
 * (@hartl)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-410/#post-16504374)
 * Hi [@isaumya](https://wordpress.org/support/users/isaumya/),
   thank you for your
   reply. I run my own VPS and as far I can tell `$_SERVER['HTTP_HOST']` is available
   from well before `init` to `shutdown`. Actually I can var_dump it just before
   line 79 of html_cache.class.php on every page request. Also I don’t see anything
   in the codebase that would reset it.Hmm, mysterious…
 *  [denisvopros](https://wordpress.org/support/users/denisvopros/)
 * (@denisvopros)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-410/#post-16506650)
 * I have the likely problem:
 * **PHP Warning:  Undefined array key “HTTP_HOST” in /var/www/mysite.com/html/wp-
   content/advanced-cache.php on line 12**
 * **PHP Warning:  Undefined array key “HTTP_HOST” in /var/www/mysite.com/html/wp-
   content/advanced-cache.php on line 13**
 * In the file – **advanced-cache.php**:
 * **Line 12**:
   $swcfpc_fallback_cache_config_path = WP_CONTENT_DIR . “/wp-cloudflare-
   super-page-cache/{$_SERVER[‘HTTP_HOST’]}/”;
 * **Line 13**:
   $swcfpc_fallback_cache_path = WP_CONTENT_DIR . “/wp-cloudflare-super-
   page-cache/{$_SERVER[‘HTTP_HOST’]}/fallback_cache/”;
 * How to fix this?
    -  This reply was modified 3 years, 3 months ago by [denisvopros](https://wordpress.org/support/users/denisvopros/).
 *  Plugin Contributor [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-410/#post-16508464)
 * Hi [@denisvopros](https://wordpress.org/support/users/denisvopros/) & [@hartl](https://wordpress.org/support/users/hartl/),
   
   Can you please try the following? Create a `test.php` file and put the following
   inside the file:
 *     ```wp-block-code
       <?php
       echo $_SERVER['HTTP_HOST'];
       ```
   
 * Then save the file and upload it to your server’s root folder where you have 
   the `wp-config.php` file. Then access this file with `https://yourdomain.com/
   test.php` and then please share the output that you get.

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

The topic ‘PHP warning’ is closed to new replies.

 * ![](https://ps.w.org/wp-cloudflare-page-cache/assets/icon-256x256.gif?rev=3234997)
 * [Super Page Cache – Cloudflare Cache, Page Speed & Core Web Vitals](https://wordpress.org/plugins/wp-cloudflare-page-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cloudflare-page-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [iSaumya](https://wordpress.org/support/users/isaumya/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-410/#post-16508464)
 * Status: resolved