Redis cpanel
WordPress¶
- It runs via socket and needs to be configured in the application config to work with the socket.
define( 'WP_REDIS_SCHEME', 'unix' );
define( 'WP_REDIS_PATH', '/home/$cpuser/ea-podman.d/ea-redis62.cpuser.01/redis.sock' );
define( 'WP_REDIS_DATABASE', 0 );
################## Redis Socket Setup ##################
#/home/vmin/ea-podman.d/ea-redis62.vmin.02/redis.sock
define( 'WP_REDIS_SCHEME', 'unix' );
define( 'WP_REDIS_PATH', '/home/$cpuser/ea-podman.d/ea-redis62.cpuser.01/redis.sock' );
define( 'WP_REDIS_DATABASE', 0 );
- Script
Drupal¶
- Install the Redis module via Composer:
- Update
settings.php
Magento¶
- Update env.php file
Joomla¶
- configuration.php file
Laravel¶
-
Update .env file
-
config/database.php
config redis-cli¶
-
Set Memory
-
Container Id can be obtain from podman ps -a command
- Get Memory value
The value is in Bytes
-
Get server info
podman exec -it -u root d4661ad912ee redis-cli INFO SERVER # Server redis_version:6.2.17 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:1fd7a5d71f5b6cc4 redis_mode:standalone os:Linux 5.14.0-570.12.1.el9_6.x86_64 x86_64 arch_bits:64 monotonic_clock:POSIX clock_gettime multiplexing_api:epoll atomicvar_api:c11-builtin gcc_version:12.2.0 process_id:1 process_supervised:no run_id:8bb1a2180e2b630ac650b98fdcbc158aaf0e99a7 tcp_port:6379 server_time_usec:1748683245175747 uptime_in_seconds:5662 uptime_in_days:0 hz:10 configured_hz:10 lru_clock:3852781 executable:/data/redis-server config_file:/usr/local/etc/redis/redis.conf io_threads_active:0 -
Redis config file is mapped to the /home/$user/ea-podman.d/redis.conf file. Values from that file are been synched to the container and in reverse.
-
Redis with Cloudlinux
-
PHP APP.
// Redis init (optional cache layer) $redis = null; // Redis init (optional cache layer) global $redis; $redis = null; if (extension_loaded('redis') && isset($cfg['redis_host'])) { try { $redis = new Redis(); $redis->pconnect( $cfg['redis_host'], $cfg['redis_port'], $cfg['redis_timeout'] ); $redis->select($cfg['redis_db']); } catch (Throwable $e) { $redis = null; } }