Undefined index: HTTP_HOST error
-
When debug.log is turned on we are getting this error/warning thousands of times a day.
[15-Aug-2019 17:34:02 UTC] PHP Notice: Undefined index: HTTP_HOST in ……/wp-content/plugins/ultimate-member/includes/core/class-permalinks.php on line 140
Host: Siteground – Cloud server
WordPress: 5.2.2
Ultimate Member: Version 2.0.54
PHP Version: 7.1.30Several plugins like Woocommerce are in use but I doubt the error is related.
Below is the code where the error is occurring (line 140). It appears to be somehow related to WP-CLI.
Any thoughts? It is generating so many errors / warnings in the debug.log file that it makes the file very large in no time.
137 if ( defined( 'WP_CLI' ) && WP_CLI ) { 138 $host = isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : 'localhost'; 139 } else { 140 $host = $_SERVER['HTTP_HOST']; 141 }
The topic ‘Undefined index: HTTP_HOST error’ is closed to new replies.