windows/linux/php中memcached.exe的安装与配置
文章介绍了关于windows+php中memcached.exe的安装与配置和liunx中 memcached配置 ,大家可根据自己的系统来方法一或方法二来配置哦。
windows+php中memcached.exe的安装与配置
1.Windows版本的下载地址为: http://code.jellycan.com/memcached/
将压缩文件解压到 c:/memcached/
2. 在CMD下输入 “c:/memcached/memcached.exe -d install” 安装。
3. 再输入:”c:/memcached/memcached.exe -d start” 启动。NOTE:以后memcached将作为windows的一个服务每次开机时自动启动。这样服务器端已经安装完毕了。
4.若指定了 -m,则表示缓存大小为 -m后的数字,单位是 M,例如:
c:/memcached/memcached.exe –l 127.0.0.1 –m 32 – d start
如下设置memcached使用内存问题帮助:
按照上面的安装步骤安装之后,使用memcached –m 200来调整最大内存占用之后会发现没有起作用,总是默认的64MB的内存,在网上搜了一下,原因是注册表中并没有写入信息,可以这样来修改。
1. memcached –d shutdown 首先关闭memcached服务。
2.进入注册表,找到 HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/memcached Server, 在其中有一个ImagePath项,值为 “c:/memcached/memcached.exe” -d runservice,在后面加上 -l 127.0.0.1 -m 3000 -c 2048。
3.memcached –d start 启动memcached服务,这样就将memcached的最大内存修改为了3000MB。
如果下载的是二进制的版本,直接运行就可以了,可以加上参数来加以设置。
常用设置:
-p
-l
-d start 启动memcached服务
-d restart 重起memcached服务
-d stop|shutdown 关闭正在运行的memcached服务
-d install 安装memcached服务
-d uninstall 卸载memcached服务
-u
-m
-M 内存耗尽时返回错误,而不是删除项
-c
-f
-n
-h 显示帮助
linux+php中memcached.exe的安装与配置
首页
http://www.danga.com/memcached
下载地址:
http://danga.com/memcached/download.bml
下载文件
memcached-1.2.6.tar.gz
tar zxvf memcached-1.2.6.tar.gz
./configure --prefix=/usr/local/memcached-1.2.6
make
make install
注意:
memcache需要这个包libevent,不然安装时要报错:
checking for libevent directory... configure: error: libevent is required. You can get it from http://www.monkey.org/~provos/libevent/
If it's already installed, specify its path using --with-libevent=/dir/
下载得到文件libevent-1.4.9-stable.tar.gz
tar zxvf libevent-1.4.9-stable.tar.gz
./configure --prefix=/usr/local/libevent-1.4.9-stable.tar.gz
make
make install
由于我安装没有安装在usr下面,所以最后启动memcache报错:
[root@localhost bin]# ./memcached -d -m 10 -p 11211 -u root -l 0.0.0.0
./memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
检查libevent安装情况:
ls -al /usr/lib | grep libevent
把 libevent-1.4.so.2 拷贝/链接到 /usr/lib 中,否则 memcached 无法正常加载。
cp libevent-1.4.so.2 /usr/lib/
文章出处:http://www.diybl.com/course/6_system/linux/linuxjq/20071010/77432.html
安装完之后要启动服务
cd /usr/local/memcached-1.2.6/bin
./memcached -d -m 50 -p 11211 -u root -l 0.0.0.0
参数说明
-m 指定使用多少兆的缓存空间;
-p 指定要监听的端口;
-u 指定以哪个用户来运行

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The way to update ByBit exchanges varies by platform and device: Mobile: Check for updates and install in the app store. Desktop Client: Check for updates in the Help menu and install automatically. Web page: You need to manually access the official website for updates. Failure to update the exchange can lead to security vulnerabilities, functional limitations, compatibility issues and reduced transaction execution efficiency.

DeepSeek is a powerful intelligent search and analysis tool that provides two access methods: web version and official website. The web version is convenient and efficient, and can be used without installation; the official website provides comprehensive product information, download resources and support services. Whether individuals or corporate users, they can easily obtain and analyze massive data through DeepSeek to improve work efficiency, assist decision-making and promote innovation.

Detailed explanation and installation guide for PiNetwork nodes This article will introduce the PiNetwork ecosystem in detail - Pi nodes, a key role in the PiNetwork ecosystem, and provide complete steps for installation and configuration. After the launch of the PiNetwork blockchain test network, Pi nodes have become an important part of many pioneers actively participating in the testing, preparing for the upcoming main network release. If you don’t know PiNetwork yet, please refer to what is Picoin? What is the price for listing? Pi usage, mining and security analysis. What is PiNetwork? The PiNetwork project started in 2019 and owns its exclusive cryptocurrency Pi Coin. The project aims to create a one that everyone can participate

There are many ways to install DeepSeek, including: compile from source (for experienced developers) using precompiled packages (for Windows users) using Docker containers (for most convenient, no need to worry about compatibility) No matter which method you choose, Please read the official documents carefully and prepare them fully to avoid unnecessary trouble.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

The official website entrance of the Coinsuper Exchange: https://www.coinsuper.com. The client download channels are: Windows client, macOS client, and mobile (iOS/Android). Registration requires an email, mobile phone number and password, and you need to complete real-name authentication before you can trade. The platform provides a variety of digital asset transactions, including Bitcoin, Ethereum, etc., with the transaction fee rate of 0.1% for both orders and acceptors. Security safeguards include cold wallet storage, dual-factor verification, anti-money laundering and anti-terrorism financing measures, and with security public

BITGet is a cryptocurrency exchange that provides a variety of trading services including spot trading, contract trading and derivatives. Founded in 2018, the exchange is headquartered in Singapore and is committed to providing users with a safe and reliable trading platform. BITGet offers a variety of trading pairs, including BTC/USDT, ETH/USDT and XRP/USDT. Additionally, the exchange has a reputation for security and liquidity and offers a variety of features such as premium order types, leveraged trading and 24/7 customer support.
