title: Warning Message: session_start(): Failed to read session data: user (path: )
body: <p>I am trying to setup an existing project with Docker. The project is in codeigniter and uses memcached as the driver to set the session.</p>
  
  <p>I created a Docker environment with <code>php:7.1.8-apache</code> and installed all the neccesary packages.</p>
  
  <p>I am now getting this error on the page</p>
  
  <p><code>Warning Message: session_start(): Failed to read session data: user (path: localhost:11211:128)</code></p>
  
  <p>I searched this on the internet a lot and tried out many things but nothing works.</p>
  
  <p>I have a file in <code>application/libraries/Session/drivers/Session_memcached_driver.php</code></p>
  
  <p>This is the the piece of code from where the error is generating but i am not sure what exactly it is.</p>
  
  <pre><code>public function read($session_id)
      {
          if (isset($this-&gt;_memcached) &amp;&amp; $this-&gt;_get_lock($session_id))
          {
              // Needed by write() to detect session_regenerate_id() calls
              $this-&gt;_session_id = $session_id;
  
              $session_data = (string) $this-&gt;_memcached-&gt;get($this-&gt;_key_prefix.$session_id);
              $this-&gt;_fingerprint = md5($session_data);
              return $session_data;
          }
  
          return $this-&gt;_fail();
      }
  </code></pre>
  
  <p>Here are my Docker Configurations:</p>
  
  <pre><code>FROM php:7.1.8-apache
  
  # AUTHOR
  MAINTAINER Development
  
  # INSTALLING PACKAGES
  RUN apt-get update &amp;&amp; apt-get install -y \
      git \
      pkg-config \
      build-essential \
      libmemcached-dev \
      libmemcached-tools \
      libicu-dev \
      libmcrypt-dev \
      libfreetype6-dev \
      libjpeg62-turbo-dev \
      libfreetype6 \
      libfontconfig \
      libxml2-dev \
      vim \
      nano \
      mysql-client \
      libldap2-dev \
      wget
  
  RUN apt-get clean
  
  # Extension PHP
  RUN docker-php-ext-install pdo pdo_mysql
  RUN docker-php-ext-install intl
  RUN docker-php-ext-install mbstring
  RUN docker-php-ext-install bcmath
  RUN docker-php-ext-install mcrypt
  RUN docker-php-ext-install zip
  RUN docker-php-ext-install exif
  RUN docker-php-ext-install soap
  RUN docker-php-ext-install opcache
  RUN docker-php-ext-install iconv
  RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
  RUN docker-php-ext-install gd
  RUN docker-php-ext-install mysqli &amp;&amp; docker-php-ext-enable mysqli
  
  # APCu
  RUN pecl channel-update pecl.php.net
  RUN pecl install apcu
  RUN echo "extension=apcu.so" &gt; /usr/local/etc/php/conf.d/apcu.ini
  
  # Enable PHP 7
  RUN a2enmod rewrite &amp;&amp; a2enmod headers &amp;&amp; a2enmod expires
  RUN a2enmod php7
  RUN echo "ServerName localhost" &gt;&gt; /etc/apache2/apache2.conf
  
  # SETUP VIRTUAL HOST
  COPY .docker/sites-available/default-vhost.conf /etc/apache2/sites-available/default-vhost.conf
  COPY .docker/sites-available/my-vhost.conf /etc/apache2/sites-available/my-vhost.conf
  RUN a2dissite 000-default.conf
  RUN a2ensite default-vhost.conf
  RUN a2ensite my-vhost.conf
  
  # Composer
  RUN curl -sS https://getcomposer.org/installer | php
  RUN mv composer.phar /usr/local/bin/composer
  
  # Memcached
  RUN apt-get update
  RUN apt-get install -y pkg-config build-essential libmemcached-dev
  RUN git clone https://github.com/php-memcached-dev/php-memcached.git
  RUN cd php-memcached &amp;&amp; git checkout php7 &amp;&amp; phpize &amp;&amp; ./configure --disable-memcached-sasl &amp;&amp; make &amp;&amp; make install
  RUN echo 'extension = memcached.so' &gt; /usr/local/etc/php/conf.d/memcached.ini
  
  # ALIASES
  RUN echo "alias ll='ls -l'" &gt;&gt; /root/.bashrc
  RUN echo "alias la='ls -l'" &gt;&gt; /root/.bashrc
  
  # COPY THE WORKING DIRECTORY
  COPY . /var/www/myproject
  
  # MANAGE DIRECTORY PERMISSIONS
  RUN chown -R www-data:www-data /var/www/myproject
  
  # SERVER RESTART
  RUN service apache2 restart
  </code></pre>
  
  <p>And this is <code>docker-compose.yml</code> settings</p>
  
  <pre><code>version: '3'
  
  services:
    app:
      build:
        context: .
        dockerfile: .docker/Dockerfile
      container_name: gaz-container
      image: gaz-docker
      ports:
        - "80:80"
      volumes:
        - .:/var/www/gaz
      links:
        - memcached:memcached
        - mysql:mysql
  
    memcached:
      image: memcached
      ports:
        - "11211:11211"
  
    mysql:
      container_name: mysql
      image: mysql:5.6
      ports:
        - "3306:3306"
      environment:
        - MYSQL_ROOT_PASSWORD=password
  </code></pre>
  
  <p>Can anyone please direct me what could be the issue here?</p>