Memcached error after updating PHP

I am using memcached and I upgraded it from PHP 5.4 to 5.6 and now it cannot connect and store.

I have:

ini_set('session.save_handler', 'memcached');
ini_set('session.save_path', 'serverAddress:11211');
session_start();

I also tried tcp: // to the server address, but no luck there.

In the error log, I get the following errors:

  • PHP warning: session_start (): Write error with lock
  • PHP warning: session_start (): cannot delete session lock record
  • PHP warning: Unknown: Failed to write session data (memcached). Make sure the current session.save_path setting is correct

I assume something has changed in PHP versions. Any help is appreciated, thanks!

Note. I am using Amazon Elastic Beanstalk for the web server and ElastiCache for memcached

What i tried

  • The configuration file is used with:

    files:
      "/etc/php.d/setup.ini":
        mode: "000644"
        owner: root
        group: root
        source: https://s3.amazonaws.com/path/to/file.ini
    

Inside the ini file there is:

    [php]

    session.save_handler = memcached
    session.save_path = 'memcached.server.path.cache.amazonaws.com:11211'
  1. session_write_close()
  2. tcp://
  3. memcache memcached .
+4

Source: https://habr.com/ru/post/1626454/


All Articles