首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Xampp上安装Memcached

问如何在Xampp上安装Memcached
EN

Stack Overflow用户
提问于 2015-04-08 14:29:31
回答 2查看 3.8K关注 0票数 2

我需要在XAMPP中使用Memcached,因为我需要在本地开发,而且到目前为止我看到的所有解决方案都不起作用。

​

代码语言:javascript
复制
Fatal error: Class 'Memcached' not found in /Applications/XAMPP/xamppfiles/htdocs/system/libraries/Session/drivers/Session_memcached_driver.php on line 108
A PHP Error was encountered

Severity: Error

Message: Class 'Memcached' not found

Filename: drivers/Session_memcached_driver.php

Line Number: 108

Backtrace:


//does not work, and actually i need this not the bottom one.
//keep in mind that the service is running, and everything was succesfully
//installed with brew

$this->_memcached = new Memcached();


//works
$this->_memcached = new Memcache;

​

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-04-08 17:02:12

找到解决办法:)

​

代码语言:javascript
复制
brew install libevent
brew install autoconf
brew install libmemcached

//Download the PHP version you are using and past it to:
cd /Applications/MAMP/bin/php/php5.6.7/include/php

//Configure the source with
/Applications/MAMP/bin/php/php5.6.7/include/php/configure

//go to
cd /Applications/MAMP/bin/php/php5.6.7/bin

//compile memcached
./pecl install memcached

//go back
cd ../

//Add the memcached.so extension to your php.ini file
echo -e "\n[memcached]\nextension=memcached.so" >> conf/php.ini

//start memcached server
memcached -m 24 -p 11211 -d

//restart MAMPP and thats it!

​

票数 2
EN

Stack Overflow用户

发布于 2018-03-14 09:43:12

这就是对我有用的东西:

  1. 安装与brew一起缓存的libmemcached: brew安装libmemcached
  2. 使用pecl安装memcached:
代码语言:javascript
复制
-  sudo /Applications/XAMPP/xamppfiles/bin/pecl install memcached 
代码语言:javascript
复制
- When prompted for the libmemcached directory, press 'Enter' and the installer will automatically find it.

​

  1. 将memcached扩展名添加到php.ini文件中:
代码语言:javascript
复制
-  sudo vim /Applications/XAMPP/xamppfiles/etc/php.ini 
代码语言:javascript
复制
- Add 'extension=memcached.so' to the file

​

  1. 重新启动Apache服务器(使用GUI或运行): sudo apachectl重新启动
  2. 使用brew启动memcached: brew服务启动memcached

使用这些指令创建了一个要旨。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29517590

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档