PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, November 12, 2022

[FIXED] How to install Memcached on Xampp Mac

 November 12, 2022     macos, memcached, php, terminal     No comments   

Issue

I need to use Memcached in XAMPP because I need to develop locally, and all solutions i've seen so far, dont work.

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;


Solution

Found the solution :)

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!



Answered By - Bruno Mota
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,213,838

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing