Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WordPress "Notice: Undefined index: host" after initial setup running locally on linux

I'm trying to set up WordPress on my laptop running Kali Linux. Everything works until I install WordPress and the theme I am using. I'm trying to use roots sage on bedrock. But after I get through the installation process I get a notice in the admin:

Notice: Undefined index: host in /var/www/html/site/web/wp/wp-includes/theme.php on line 2937
Notice: Undefined index: host in /var/www/html/site/web/wp/wp-includes/theme.php on line 2937
Notice: Undefined index: host in /var/www/html/site/web/wp/wp-includes/theme.php on line 2999
Notice: Undefined index: host in /var/www/html/site/web/wp/wp-includes/theme.php on line 2999

And in the frontend:

Notice: Undefined index: host in /var/www/html/site/web/wp/wp-includes/theme.php on line 2999
Notice: Undefined index: host in /var/www/html/site/web/wp/wp-includes/theme.php on line 2999

Can anyone explain why I'm getting these notices? I must have missed something but I've gone through the instructions several times and I'm out of ideas. Thanks

like image 811
DK_ Avatar asked Dec 23 '16 19:12

DK_


2 Answers

You can define WP_HOME & WP_SITEURL in wp-config.php

define('WP_HOME','http://localhost/project_folder_name');
define('WP_SITEURL','http://localhost/project_folder_name');
like image 89
Prashant Suthar Avatar answered Nov 05 '22 16:11

Prashant Suthar


This can also be caused by an error with the siteurl and home options in wp_options table.

Make sure the url's have a host as well, http://example.com not just example.com.

like image 30
Mugur 'Bud' Chirica Avatar answered Nov 05 '22 15:11

Mugur 'Bud' Chirica