Web GUI for managing Redis, Memcached, APCu, OPCache and Realpath with data management.
50K+
https://github.com/RobiNN1/phpCacheAdmin
Web GUI for managing Redis, Valkey, KeyDB, Memcached, APCu, OPCache, and Realpath with data management.
authusers).-o track_sizes.There is also a Server dashboard for a quick look at the machine phpCacheAdmin runs on - PHP version and
configuration, loaded extensions, phpinfo(), and CPU, RAM and disk usage.
There is no authentication until you define users in PCA_AUTHUSERS, so anyone who can open the page can also read,
change and delete everything in the configured servers. A published port is reachable by anyone who can reach the
host, so keep it on 127.0.0.1 as in the examples below, or turn the login page on. Setting PCA_READONLY leaves
only the read-only parts of the dashboards, and PCA_CONSOLE=false removes the Redis and Memcached consoles.
Run with a single command:
docker run -p 127.0.0.1:8080:80 -d --name phpcacheadmin -e "PCA_REDIS_0_HOST=redis_host" -e "PCA_REDIS_0_PORT=6379" -e "PCA_MEMCACHED_0_HOST=memcached_host" -e "PCA_MEMCACHED_0_PORT=11211" robinn/phpcacheadmin
Or use it in docker-compose.yml
services:
phpcacheadmin:
image: robinn/phpcacheadmin
ports:
- "127.0.0.1:8080:80"
#volumes:
# If you want to use config.php instead of ENV variables
# - "./config.php:/var/www/html/config.php"
environment:
- PCA_REDIS_0_HOST=redis
- PCA_REDIS_0_PORT=6379
- PCA_MEMCACHED_0_HOST=memcached
- PCA_MEMCACHED_0_PORT=11211
depends_on:
- redis
- memcached
redis:
image: redis:8-alpine
memcached:
image: memcached:alpine
Both examples publish the port to 127.0.0.1, so the dashboard is reachable from that machine only - through an SSH
tunnel from anywhere else. Drop the address (-p 8080:80) to open it to the network, and turn the login page on when
you do:
environment:
- PCA_AUTHUSERS={"admin":"your-password"}
The password can also be a password_hash() hash. In a compose file every $ in it has to be written as $$,
otherwise compose treats it as a variable.
You can add these links to your cronjob to collect metrics when the dashboard is not open:
Redis https://example.com/phpCacheAdmin/?dashboard=redis&server=0&ajax&metrics
Memcached https://example.com/phpCacheAdmin/?dashboard=memcached&server=0&ajax&metrics
server=0is the default server ID.
Metrics are collected whenever this link is refreshed, so you can set any time in the cronjob.
If you have authentication enabled, set PCA_AUTHTOKEN and append &token=your-secret-token
to the cronjob URL so it can collect metrics without a login session.
All keys from the config file are supported ENV variables,
they just must start with PCA_ prefix.
Options with an array can be set using "dot notation" but use _ instead of a dot.
Or you can even use JSON (e.g., Redis SSL option).
Redis:
PCA_REDISCLIENT redis or predis. Auto-detected when not set.PCA_REDIS_0_NAME The server name (optional).PCA_REDIS_0_HOST Optional when a path or nodes is specified.PCA_REDIS_0_NODES List of cluster nodes. You can set value as JSON ["127.0.0.1:7000","127.0.0.1:7001","127.0.0.1:7002"].PCA_REDIS_0_SENTINELS List of Sentinels, replaces the host/port when set. You can set value as JSON ["127.0.0.1:26379","127.0.0.1:26380","127.0.0.1:26381"].PCA_REDIS_0_SENTINELMASTER Name of the monitored master (optional). Default mymaster.PCA_REDIS_0_SENTINELPASSWORD Password of the Sentinels themselves, not of the master (optional).PCA_REDIS_0_PORT Optional when the default port is used.PCA_REDIS_0_SCHEME Connection scheme (optional). If you need a TLS connection, set it to tls.PCA_REDIS_0_SSL SSL options for TLS. Requires Redis >= 6.0 (optional). You can set value as JSON {"cafile":"private.pem","verify_peer":true}.PCA_REDIS_0_DATABASE Default database (optional).PCA_REDIS_0_USERNAME ACL - requires Redis >= 6.0 (optional).PCA_REDIS_0_PASSWORD Optional.PCA_REDIS_0_AUTHFILE File with a password, e.g., Docker secrets (optional).PCA_REDIS_0_PATH Unix domain socket (optional).PCA_REDIS_0_DATABASES Number of databases, use this if the CONFIG command is disabled (optional).PCA_REDIS_0_SCANTHRESHOLD Use SCAN automatically instead of KEYS when the database has more keys than this, 1000 keys are retrieved (optional). Default 100_000.PCA_REDIS_0_SCANSIZE Always use SCAN and retrieve at most this many keys, regardless of the threshold (optional).PCA_REDIS_0_SEPARATOR Separator for the tree view (optional).Memcached:
PCA_MEMCACHED_0_NAME The server name (optional).PCA_MEMCACHED_0_HOST Optional when a path is specified.PCA_MEMCACHED_0_PORT Optional when the default port is used.PCA_MEMCACHED_0_PATH Unix domain socket (optional).PCA_MEMCACHED_0_SEPARATOR Separator for the tree view (optional).PCA_MEMCACHED_0_EXTENSION Enable the Memcached extension only for get and set operations (optional).Other:
PCA_AUTHUSERS Users for the login page as JSON, e.g. {"admin":"your-password"}. Auth is off while it is empty.PCA_AUTHTOKEN Token for the metrics cronjob.PCA_READONLY Set it to true to block every destructive action (optional).PCA_CONSOLE Set it to false to remove the Redis and Memcached consoles (optional).PCA_PHP_MEMORY_LIMIT In case you need to increase the PHP memory limit in Docker.PCA_NGINX_PORT In case you need to change NGINX port in Docker.Open the config file for more info.
To add another server, add the same environment variables, but change
0to1(2for the third server and so on).
You can keep these variables in a .env file instead of exporting them in the shell.
This requires vlucas/phpdotenv:
composer require vlucas/phpdotenv
Copy .env.example to .env and adjust the values.
The following files are loaded automatically (in order of precedence, the more specific file wins):
.env.{environment}.local.env.{environment}.env.local.env{environment} comes from the PCA_ENV (or APP_ENV) variable, e.g., PCA_ENV=development also loads .env.development.
This lets you keep committed defaults in .env and override them locally in .env.local, which is git-ignored.
Real environment variables (e.g., set by Docker) always take precedence over the values in .env files,
so you can still override anything at runtime.
It is not necessary to have all dashboards enabled.
Content type
Image
Digest
sha256:8181b78cb…
Size
15.2 MB
Last updated
7 days ago
docker pull robinn/phpcacheadmin