I've recently setup Wordpress locally using XAMP on windows 7. I've created an SQL database for my install and setup some config files to handle the live server and local for use when I start using git.
I have a wp-local-config.php:
<?php
// Local server settings
// Local Database
define('DB_NAME', '<mysiteuser>');
define('DB_USER', '<mydbuser>');
define('DB_PASSWORD', '<db password>');
define('DB_HOST', 'localhost');
// Overwrites the database to save keep edeting the DB
define('WP_HOME','/client.dev');
define('WP_SITEURL','/client.dev');
// Turn on debug for local environment
define('WP_DEBUG', true);
And my wp-config.php
<?php
// Use these settings on the local server
if ( file_exists( dirname( __FILE__ ) . '/wp-local-config.php' ) ) {
include( dirname( __FILE__ ) . '/wp-local-config.php' );
// Otherwise use the below settings (on live server)
} else {
// Live Server Database Settings
define( 'DB_NAME', '<live db name>');
define( 'DB_USER', '<live db user>');
define( 'DB_PASSWORD', '<live db pw>' );
define( 'DB_HOST', 'localhost' );
// Overwrites the database to save keep edeting the DB
define('WP_HOME','http://<client url>');
define('WP_SITEURL','http://<client url>');
// Turn Debug off on live server
define('WP_DEBUG', false);
}
However when I login to my wordpress install I get lots of debug errors such as:
(At the top of the screen)
Notice: Undefined index: host in C:\xampp\htdocs\client.dev\wp-includes\theme.php on line 1820
Notice: Undefined index: host in C:\xampp\htdocs\client.dev\wp-includes\theme.php on line 1820
Notice: Undefined index: host in C:\xampp\htdocs\client.dev\wp-includes\theme.php on line 1876
Notice: Undefined index: host in C:\xampp\htdocs\client.dev\wp-includes\theme.php on line 1876
In the wordpress new:
Notice: Undefined index: host in C:\xampp\htdocs\client.dev\wp-includes\http.php on line 470
Notice: Undefined index: host in C:\xampp\htdocs\client.dev\wp-includes\class-http.php on line 129
Can anyone help me find out why this is happening?