Problem with memcached
Powerful tool for modern apps: Django, Rails, Laravel, Node, Go, Java
Brought to you by:
leokhoa
Thanks for Laragon!
Just one thing. I am working with Laravel. I had a single problem with memchached. I configured app/cache.php with memcached:
'driver' => 'memcached',
'memcached' => array(
array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
),
but I've obtain the following error:
Class 'Memcached' not found
The problem is Laragon or configuration Laravel?
Thank you and congratulations!
The problem is: Laravel supports only Memcached
Developing PHP app with Memcached on Windows seems impossible because the PHP extension only support Memcache (note: without a d) on Windows
However, Laragon solves the problem. Just put the code below to where you feel convenient and it should work (Tested)
Code
Please let me know if it works for you and kindly help other developers overcome the problem.
Btw, thank you for evaluating Laragon 5 Stars.
Last edit: Leo Khoa 2016-11-10
where should i put this code in Lumen project?
Yes, it works! In my Laravel 4 project:
app/config/cache.php
'memcached' =>
array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
),
app/start/global.php
if (!class_exists('Memcached')) {
include ("memcached.php");
}
Thanks Leo!
Hi,
For the solution suggested, what is included in memcached.php ?
Could you please share the details on what this has ?
Hi Rebecca,
I believe memcached.php is a client class for windows for memcached that Leo decided to include in DIR:\lamp\bin\php\php-5.6.7\PEAR.
Thanks for including this Leo! Putting the code snippet above the return in the local laravel environment's cache.php worked wonders for me!
For those wondering, my entire cache.php:
app/config/localdev/cache.php
Thanks for the details.
Hi.. I have added the cache.php with what Leo wrote.. but i have this error.. "No Memcached servers added".. Where have I done wrong? Thank you for the support
Last edit: Yoga Hadi Nugroho 2015-11-19
Hi Yoga,
You must run Memcached first. Go to Preferences/Services & Ports, then check Memcached.