1 |
If you are trying to upload a WordPress site to OpenShift you will have to make the following adjustments to your wp-config.php file:
1 2 3 |
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME',$_ENV['OPENSHIFT_GEAR_NAME']); |
1 |
/** MySQL database username */ define(‘DB_USER’, $_ENV[‘OPENSHIFT_MYSQL_DB_USERNAME’]);
1 |
/** MySQL database password */ define(‘DB_PASSWORD’, $_ENV[‘OPENSHIFT_MYSQL_DB_PASSWORD’]);
1 |
1 2 |
/** MySQL hostname */ define('DB_HOST', $_ENV['OPENSHIFT_MYSQL_DB_HOST'] . ':' . $_ENV['OPENSHIFT_MYSQL_DB_PORT']); |
This will help WordPress to use the environment variables that OpenShift setup to connect to MySQL.