Created
January 9, 2018 02:38
-
-
Save chihirokaasan/c8950fc86243eaa52e5700777e18d364 to your computer and use it in GitHub Desktop.
WordPress config.php Switch databases in production and testing environments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** WordPress のためのデータベース名 */ | |
/** テスト環境のHOST */ | |
if($_SERVER["HTTP_HOST"] == "testURL.jp") { | |
define('DB_NAME', 'test_DB_Name'); | |
/** MySQL データベースのユーザー名 */ | |
define('DB_USER', 'DB_Test_User_Name'); | |
/** MySQL データベースのパスワード */ | |
define('DB_PASSWORD', 'Test_DB_PASSWD'); | |
/** MySQL のホスト名 */ | |
define('DB_HOST', '127.0.0.1'); | |
} else { | |
define('DB_NAME', 'Production_DB_NAME'); | |
/** MySQL データベースのユーザー名 */ | |
define('DB_USER', 'DB_Production_User_Name'); | |
/** MySQL データベースのパスワード */ | |
define('DB_PASSWORD', 'Production_DB_PASSWD'); | |
/** MySQL のホスト名 */ | |
define('DB_HOST', '127.0.0.1'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment