2.14.16.1. Configure Memcache in SMF

After connecting Memcache you might encounter this error:

2: memcache_connect () expects parameter 2 to be long, string given
File: /home/example/example.com/www/Sources/Load.php Line: 2742

To fix the error, do the following:

  1. Open /Sources/Load.php file and find the following line in it:
    $memcached = memcache_connect($server[0], empty($server[1]) ? 11211 : $server[1]);
  2. Replace the found string with the following:
    $memcached = memcache_connect('unix:///home/example/.system/memcache/socket', 0);

    Instead of example substitute hosting account name where site is hosted.

  3. In the same file, find the line:
    $memcached = memcache_pconnect($server[0], empty($server[1]) ? 11211 : $server[1]);
  4. Replace the found string with the following:
    $memcached = memcache_pconnect('unix:///home/example/.system/memcache/socket', 0);

    Instead of example substitute hosting account name where site is hosted.

  5. Save the changes.
  6. Check the site operation.

No configuration in site admin panel is required.

Tabla de conținut