Plugin Contributor
iSaumya
(@isaumya)
Hi @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
(@hartl)
Hi @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…
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.
Plugin Contributor
iSaumya
(@isaumya)
Hi @denisvopros & @hartl,
Can you please try the following? Create a test.php file and put the following inside the file:
<?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.