php redis data loss solution: 1. Find "/etc/sysctl.conf"; 2. Add "vm.overcommit_memory = 1"; 3. Use "sysctl -p" to make the configuration effective; 4. , just restart the linux server.
The operating environment of this tutorial: linux5.9.8 system, PHP version 8.1, Dell G3 computer.
php What to do if redis data is lost?
Redis data is lost after the Linux server is restarted
Direct solution:
1. Find /etc/sysctl.conf
vim /etc/sysctl.conf
2. Add
vm.overcommit_memory = 1
3.wq to the last line and save it. Use sysctl -p to make the configuration effective.
sysctl -p
will return the added line, indicating that the addition is successful.
After the Linux server is restarted, the redis data will not be lost.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What to do if php redis data is lost. For more information, please follow other related articles on the PHP Chinese website!