Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-53947

Memcached sessions fail on PHP 7

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0, 3.0.4, 3.1.1
    • Fix Version/s: 3.0.5, 3.1.1
    • Component/s: Caching
    • Labels:
    • Testing Instructions:
      Hide
      PHP7 memcached extension setup
      1. Install Moodle on a machine running on PHP7.
      2. Install and set up memcached.
      3. Download and extract the PHP7 memcached extension here.
      4. Open a terminal application and go to the extracted folder.
      5. Build the memcached extension according to https://github.com/php-memcached-dev/php-memcached/tree/php7#readme.
      6. Go to the modules folder.
      7. Copy the built memcached.so into /usr/lib/php/20151012. (If there's an existing memcached.so file, back it up first).
      8. Restart the web server.
      Testing
      1. Go to Site administration ► Development ► Debugging.
      2. Set the Debug messages to DEVELOPER and save the changes.
      3. Go to Site administration ► Plugins ► Caching ► Configuration. Check the Installed cache stores section.
        • Confirm that the Memcached plugin is ready (checked)
      4. Edit your Moodle installation's config.php and append the following lines:

        $CFG->session_handler_class = '\core\session\memcached';
        $CFG->session_memcached_save_path = 'localhost:11211';
        

      5. Refresh the page.
        • Confirm that the following deprecation warning is not being shown:

          Deprecated: ini_set(): memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in /path/to/moodle/lib/classes/session/memcached.php on line 139

      Show
      PHP7 memcached extension setup Install Moodle on a machine running on PHP7. Install and set up memcached. Download and extract the PHP7 memcached extension here . Open a terminal application and go to the extracted folder. Build the memcached extension according to https://github.com/php-memcached-dev/php-memcached/tree/php7#readme . Go to the modules folder. Copy the built memcached.so into /usr/lib/php/20151012 . (If there's an existing memcached.so file, back it up first). Restart the web server. Testing Go to Site administration ► Development ► Debugging. Set the Debug messages to DEVELOPER and save the changes. Go to Site administration ► Plugins ► Caching ► Configuration. Check the Installed cache stores section. Confirm that the Memcached plugin is ready (checked) Edit your Moodle installation's config.php and append the following lines: $CFG->session_handler_class = '\core\session\memcached'; $CFG->session_memcached_save_path = 'localhost:11211'; Refresh the page. Confirm that the following deprecation warning is not being shown: Deprecated: ini_set(): memcached.sess_lock_wait and memcached.sess_lock_max_wait are deprecated. Please update your configuration to use memcached.sess_lock_wait_min, memcached.sess_lock_wait_max and memcached.sess_lock_retries in /path/to/moodle/lib/classes/session/memcached.php on line 139
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-53947-master

      Description

      memcached.sess_lock_max_wait has been changed to memcached.sess_lock_wait_max for php-memcached v3+.

      Although it only mentions it being "deprecated" and suggests you switch, I have noticed the session failing to lock when using sess_lock_max_wait (this bit could just be because it is still alpha though...).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jul/16