Redis related packages
Phpredis – 2.2.4. Tar. Gz
phpredis-develop.zip
Redis – 4.0.6. Tar. Gz
Link: https://pan.baidu.com/s/1eSOwqhO password: af4c
1. Unzip, compile and install tar-Zxvf Redis-4.0.6.tar.gz
CD redis – 4.0.6/SRC
make
make install
2. You can see some green files when moving ls redis-4.0.6/ SRC
mkdir -p /usr/local/redis/etc ###etc has a storage configuration file
mkdir -p /usr/local/redis/bin ###bin is used to store commands
Copy redis.conf under redis.4.0.6 to /usr/local/redis/etc/
cp ../redis. Conf/usr/local/redis/etc /
copy the green file under redis-4.0.6/ SRC folder to /usr/local/redis/bin
cp green file name /usr/local/redis/bin/
CD/usr/local/redis/bin
ls
3. Start redIS service. Starting the RedIS service requires the command Redis-server./ Redis-server
Warning: no config file specified,
after the termination
/redis server/usr/local/redis/etc/redis. Conf
now redis is running in the foreground
redis runs in the background
vi /usr/local/redis/etc/redis.conf
search: /daemonize
changes the daemonize configuration entry to yes
save exit
./redis-server /usr/local/redis/etc/redis.conf
ps -ef | grep redis
pstree -p | grep redis ## tree display
netstat – NTLP | grep 6379 ### port
[linuxidc@localhost bin]$ /usr/local/redis/bin/redis-cli
127.0.0.1:6379 & gt;// hint
indicates successful client login
4. Join systemctl configure redis vi/usr/lib/systemd/system/redis. Service
[Unit]
Description=Redis
After=network.target
[Service]
#Type=forking
PIDFile=/run/redis_6379.pid
ExecStart =/usr/local/redis/bin/redis server/usr/local/redis/etc/redis. Conf – daemonize no
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop =/usr/local/redis/bin/redis – 127.0.0.1 cli – h – p 6379 shutdown
PrivateTmp=true
[Install]
WantedBy=multi-user.target
save exit
systemctl daemon-reload
systemctl start redis
systemctl enable redis
systemctl is-enabled redis
if an error occurs
systemctl enable redis
Failed to execute operation: Bad message
Please check the/usr/lib/systemd/system/redis. Service file
5. Install the PHPREdis-Develop.zip extension if you have PHP installed
download address: https://github.com/phpredis/phpredis/archive/develop.zip
unzip phpredis – develop. Zip
cd phpredis-develop
/usr/local/php7/bin/phpize
./configure –with-php-config=/usr/local/php7/bin/php-config
make
(see result: Don’t forget to run ‘make test’. That is success.)
make install
(see the results as follows: Installing Shared extensions:/usr/local/php7/lib/PHP/extensions/no – debug – non – ZTS – 20160303 /
)
: Shared extensions, has generated the dynamic link library file redis. So.
can check if there is redis.so
ls/usr/local/php7/lib/PHP/extensions/no – debug – non – ZTS – 20160303 /
file redis.so path
phpredis-develop/modules/redis.so
phpredis-develop/.libs/redis.so
/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/redis.so
three files are the same file
Configure php.ini to add after extension
extension=redis.so
restart PHP
Test redis CD
vi test.php
< ?php
$redis = new redis();
$redis-> The connect (‘ 127.0.0.1, 6379);
echo ‘Connection to server successfully’;
echo ‘Server is running:’ . $redis-> ping();
:wq
to perform the test. The PHP
php test.php
in case of Fatal error: Uncaught error: Class ‘redis’ not found
may be because running the PHP command and apache or ngnix may use a different php.ini. Even if you see redis loaded in php.ini, you also need to add redis module in php.ini to the PHP command line.
address:
1. View phpinfo in php.ini location
/usr/local/php7/etc/php.ini
2. Search the php.ini file location
/usr/local/php7/lib/
3. Cp/usr/local/php7/etc/PHP ini/usr/local/php7/lib/PHP ini
4. Restart php-fpm nginx redis
5. Execute test.php
[root@192 /]# php test.php
Connection to server successfullyServer is running:+PONG[root@192 /]#
php -m | grep redis
Read More:
- (20200916 Solved)Docker||redis-cli Could not connect to Redis at 127.0.0.1:6379: Connection refused
- Error connecting to redis on localhost:6379 (Redis::TimeoutError)
- Solution to redis error in CentOS of idea connected virtual machine
- Redis: How to Configurate Redis.conf File
- [Solved] Redis Error: org.springframework.data.redis.RedisConnectionFailureExceptionjava.net.SocketTimeoutException
- Fatal error in PHP project: class’ redis’ not found
- Mac php7.4.13 using PECL installation extension to report error
- No such file or directory error when redis is started under Windows
- Redis compilation error cannot find config.m4
- The local program cannot access the test environment redis cluster through public IP_ compromise
- Redis cannot load windows.conf
- Redis cli create creates an error when creating a cluster
- ERR Slot 3300 is already busy (Redis::CommandError)
- Connection error:Cannot connect to redis-server. Details are available in connection log.
- JWT and token + redis scheme of spring security
- Redis: (error) MOVED 8352 192.168.145.128:6380 [How to Solve]
- Termux installing redis
- Stackexchange.redis data timeout [How to Solve]
- Windows redis startup error reported: Creating Server TCP listening socket 127.0.0.1:6379: bind: No error