centos安装memcached
时间: 2024-02-20 21:55:13 浏览: 92
CentOS是一种常用的Linux操作系统,而Memcached是一个高性能的分布式内存对象缓存系统。下面是在CentOS上安装Memcached的步骤:
1. 使用root用户登录到CentOS服务器。
2. 打开终端,并执行以下命令以更新系统软件包:
```
yum update
```
3. 安装Memcached和其依赖库:
```
yum install memcached
```
4. 安装完成后,启动Memcached服务:
```
systemctl start memcached
```
5. 若要设置Memcached在系统启动时自动启动,执行以下命令:
```
systemctl enable memcached
```
6. 默认情况下,Memcached监听在本地IP地址127.0.0.1和默认端口11211上。如果需要修改监听地址和端口,可以编辑配置文件`/etc/sysconfig/memcached`。
7. 验证Memcached是否成功安装并运行,可以使用telnet命令连接到Memcached服务器:
```
telnet 127.0.0.1 11211
```
如果连接成功,表示Memcached已经安装并运行。
相关问题
php 7 安装 memcached,centos在php7.4版本安装memcached扩展
在 CentOS 上安装 memcached 扩展需要以下步骤:
1. 确保已经安装了 PHP 和 memcached 服务
```
sudo yum install php php-devel php-pear libmemcached libmemcached-devel memcached
```
2. 安装 memcached 扩展
```
sudo pecl install memcached
```
3. 在 /etc/php.ini 文件中添加以下行(根据你的 PHP 版本选择相应的行):
```
extension=memcached.so
```
4. 重启 Apache 或 PHP-FPM 服务
```
sudo systemctl restart httpd
或
sudo systemctl restart php-fpm
```
完成后,你可以在 PHP 应用程序中使用 memcached 扩展了。
centos安装memcache
1. 安装依赖包
```
yum install libevent libevent-devel -y
```
2. 安装memcached
```
yum install memcached -y
```
3. 启动memcached
```
systemctl start memcached
```
4. 设置memcached自启动
```
systemctl enable memcached
```
5. 验证是否安装成功
```
telnet localhost 11211
```
如果出现以下提示,则表示安装成功:
```
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)