Home  >  Article  >  Backend Development  >  PHP redis extension supports scan command implementation method

PHP redis extension supports scan command implementation method

高洛峰
高洛峰Original
2016-12-21 10:44:271543browse

When I used Alibaba Cloud's kvstore, it was a public beta at first and there was no charge. Later it became a commercial model and there was a charge. It cost 8 yuan an hour, which was too expensive, so I thought of deleting some useless data, but the amount of data It was too huge, and it was not possible to use keys * to match (using keys * will directly freeze your redis). Later I learned that scan can find all keys with a cursor, so I started tinkering with it (I found a lot of nonsense). .

Start drying. .

[codesyntax]

# git clone https://github.com/phpredis/phpredis
# cd phpredis
# /opt/php/bin/phpize 
# ./configure --with-php-config=/opt/php/bin/php-config 
# make && make install

[/codesyntax]

Pay attention to your php installation path

Restart the php-fpm program and it’s done. . .

Thanks for reading, I hope it can help everyone, thank you for your support of this site!

For more articles related to how the PHP redis extension supports the scan command, please pay attention to 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