You don’t know how to install redis on WordPress. So i tell you how you can install it easily using command and plugins. So now follow steps on Cpanel.
on VPS and Dedicated hosting
1st Step
- Open cpanel and open Terminal.
- write command yum update then press enter button.
- write command yum install redis then press enter button.
- write command systemctl start redis then press enter button.
- write command systemctl enable redis then press enter button.
2nd step
- Install redis plugin from WordPress dashboard plugin section.
- Now enable redis object plugin.
on cloud hosting
1st Step
- Open SSH or command terminal and paste code for check updates.
sudo apt update
- Now use this code for install redis step on server.
sudo apt install redis-server
- Then use sudo nano /etc/redis/redis.conf and see bind 127.0.0.1. if bind 127.0.0.1 have then click ctrl+S button for save. Then ctrl+X for exit editor mode.
- Use code for restart Apache server.
sudo systemctl restart redis-server
- Now use code for install redis on server.
sudo apt install php-redis sudo systemctl restart apache2
- Then open wp-config.php file add give code there.
define('WP_CACHE', true); define('WP_REDIS_HOST', '127.0.0.1'); define('WP_REDIS_PORT', '6379');
- Now use sudo systemctl restart redis-server command for restart server.
2nd step
- Install redis plugin from WordPress dashboard plugin section.
- Now enable redis object plugin.
This code tested by me and its words perfectly. Hope this will work on your website. Thank for visiting.