我需要在XAMPP中使用Memcached,因为我需要在本地开发,而且到目前为止我看到的所有解决方案都不起作用。
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;
发布于 2015-04-08 17:02:12
找到解决办法:)
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!
发布于 2018-03-14 09:43:12
这就是对我有用的东西:
- sudo /Applications/XAMPP/xamppfiles/bin/pecl install memcached - When prompted for the libmemcached directory, press 'Enter' and the installer will automatically find it.
- sudo vim /Applications/XAMPP/xamppfiles/etc/php.ini - Add 'extension=memcached.so' to the file
使用这些指令创建了一个要旨。
https://stackoverflow.com/questions/29517590
复制相似问题