By Hardik Savani May 20, 2021 Category : LaravelPlayUnmuteLoaded: 1.17%FullscreenHi Artisan,
In this tute, we will discuss how to use memcached in laravel. i would like to share with you laravel cache memcached. it's simple example of laravel cache driver memcached. We will look at example of laravel use memcached. Follow bellow tutorial step of install memcached php laravel.
Laravel provide several driver for cache your app with database query, view etc. here i will give you step by step instruction how to install and use memcached as cache driver in laravel application. you can easily use memcached with laravel 6, laravel 7, laravel 8 and laravel 9 version.
let's see step by step configuration memcached driver.
Install Memcached in Server:
in this step we need to install memcached in ubuntu server and php extension for it. so let's run both command:
sudo apt-get install memcached
next you need to install php extension for memcached. it's version specify so it will install with your php version like "sudo apt-get install php7.3-memcached", sudo apt-get install php7.4-memcached etc. but for default you can use as like bellow command:
sudo apt-get install php-memcached
Configure Memcached Driver:
now, we need to configure cache driver as memcached on env file as like bellow:
.env
CACHE_DRIVER=memcached
you can see bellow cache config file it will as bellow: