skip to Main Content

I’m working in PHP 7.1 with Laravel 5.5. The error thrown is:

Failed to create session ID: memcached (path: localhost:11211)

The code causing the error is:

if (session_status() === PHP_SESSION_NONE) {
  session_start(); // error on this line
}

My sessions are supposed to be files, which are successfully created:

/config/session.php
  'driver' => env('SESSION_DRIVER', 'file'),

/config/cache.php
  'driver' => env('CACHE_DRIVER', 'file'),

/.env
  CACHE_DRIVER=file
  SESSION_DRIVER=file

So I can’t figure out why memcached is pitching a fit or why session_start() is unable to return the ID it is clearly creating.

2

Answers


  1. Have you check if php session save.path is using memcached?

    Login or Signup to reply.
  2. Have you checked your memcached config? The session will go wrong if php-fpm cant connect to memcached.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search