Forum Moderators: rogerd & travelin cat
// Local config file should be outside the server's DOCUMENT_ROOT
$config_file = '/path/to/local-wp-config.php';
if (file_exists($config_file)) {
include($config_file);
}
else {
define('WP_HOME','https://liveserver.com');
define('WP_SITEURL','https://liveserver.com');
define('DB_NAME', 'liveDB');
define('DB_USER', 'liveDBuser');
define('DB_PASSWORD', 'liveDBpass');
define('DB_HOST', 'localhost');
}
since I have many local installs, I give them all a nameMine are all called “local”, as in
you guys are about 10 miles over my head on this oneSpeaking strictly for myself: I don't speak a word of Apache and would flee in terror from a live server. In order to run multiple sites off a single MAMP install without having to keep changing preferences, I had to do some internet searching to learn how to edit my computer's hosts file. Basically this involves carefully typing exactly what it tells me to type. (I shun Terminal like the very devil, and will go to considerable lengths to avoid using it, so this was a very unpleasant and scary exercise.) In other words, I did exactly what I keep telling people not to do.
Laragon