Using environment variables in master.php config file
-
Hello, I am using this plugin in a WordPress app running on AWS Elastic Beanstalk. I have a Elasticache Memcached cluster setup and would like to reference an environment variable instead of hardcoding the server address in
master.php. Here is what my master.php file looks like. this file appears to be ignored and a default master.php is created.<?php
if (!defined('W3TC_DIR')) {
exit;
}
// Set the Memcached server dynamically with a fallback
$memcached_server = isset($_SERVER['MEMCACHED_ENDPOINT']) ? $_SERVER['MEMCACHED_ENDPOINT'] : '127.0.0.1:11211';
return array(
"version" => "2.8.2",
"cluster.messagebus.debug" => false,
"cluster.messagebus.enabled" => false,
"cluster.messagebus.sns.region" => "",
"cluster.messagebus.sns.api_key" => "",
"cluster.messagebus.sns.api_secret" => "",
"cluster.messagebus.sns.topic_arn" => "",
"dbcache.configuration_overloaded" => false,
"dbcache.debug" => false,
"dbcache.debug_purge" => false,
"dbcache.enabled" => true,
"dbcache.engine" => "memcached",
"dbcache.file.gc" => 3600,
"dbcache.file.locking" => false,
"dbcache.lifetime" => 180,
"dbcache.memcached.persistent" => true,
"dbcache.memcached.aws_autodiscovery" => false,
"dbcache.memcached.servers" => array($memcached_server),
"dbcache.memcached.username" => "",
"dbcache.memcached.password" => "",
"dbcache.memcached.binary_protocol" => true,
"dbcache.redis.persistent" => true,
"dbcache.redis.servers" => array(
"127.0.0.1:6379"
),
// ... remainder of settings
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Using environment variables in master.php config file’ is closed to new replies.