Home >Backend Development >PHP Problem >What to do if php redis data is lost

What to do if php redis data is lost

藏色散人
藏色散人Original
2022-11-14 09:56:571978browse

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.

What to do if php redis data is lost

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn