Skip to content
Advertisement

Class ‘Memcached’ not found in laravel

I am trying to run simple code of cache using memcache in my laravel project.

I have added CACHE_DRIVER=memcached in my .env file.

I have created folder of memcache in C drive and added a file memcache.exe in that, and run in cmd by opening it as administrator.

my code in route is:

JavaScript

when I run this route, i get error as

Class ‘Memcached’ not found

Is there any solution?

EDIT:

When i remove CACHE_DRIVER=memcached and use CACHE_DRIVER=file above code runs fine. What is correct way CACHE_DRIVER=memcached or CACHE_DRIVER=file? I had referred that from video 1

Advertisement

Answer

You need to install the memcached extension to your server.

If you are using linux then

JavaScript

Here is the launchpad link and here’s pecl’s link

Update :

If you are using xampp in windows you should just do this

In your php.ini file just remove the semi colon before this

JavaScript

to

JavaScript

and then restart your server

Note :

Don’t forget to restart or stop and start your server after you install this.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement