Set default value for $_SERVER[‘HTTP_HOST’]
-
Dear Majumder
We’ve recently observed this error log message a couple times:
'PHP message: PHP Warning: Undefined array key "HTTP_HOST" in /home/www/htdocs/wp-content/advanced-cache.php on line 12; PHP message: PHP Warning: Undefined array key "HTTP_HOST" in /home/www/htdocs/wp-content/advanced-cache.php on line 13; PHP message: PHP Warning: Undefined array key "HTTP_HOST" in /home/www/htdocs/wp-content/advanced-cache.php on line 200'
Per the wp-cli handbook, the fix seems to be to add something to advanced-cache.php along the lines of:
if ( ! isset( $_SERVER['HTTP_HOST'] ) ) { $_SERVER['HTTP_HOST'] = 'example.com'; }
I wonder what your thoughts are on this.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Set default value for $_SERVER[‘HTTP_HOST’]’ is closed to new replies.