Garry

XenForo memcached setup how to use it?

Recommended Posts

Hi,

Just setting up my XenForo and would like to use memcached, by default it uses a port, but I understand you use a socket setup.
Anyway how do I config XenForo to work with Socket, instead of port?

PS. I didn't want to post in the phpBB3 post as it could be seen as being rude.

 

Share this post


Link to post
Share on other sites

It isn't working, I am running PHP 7.1, with memcached ticket in the settings, I have also started Memcached via cPanel.

XenForo is say:
Zend_Cache_Exception: The memcache extension must be loaded for using this backend ! - library/Zend/Cache.php:209

This is the XenForo setup I have in the config.php file

$config['cache']['backend'] = 'Memcached';
$config['cache']['backendOptions'] = array(
    'compression' => false,
    'servers' => array(
        array(
            'host' => 'unix:///home/XXXXXX/.hostdata/memcached.sock',
            'port' => 0,
        )
    )
);



I have also tried the host as

unix:///var/memcached/memcached.socket




 

Share this post


Link to post
Share on other sites

The problem is it is utilizing the memcache extension which is only available until PHP 5.6.  I'd suggest contacting Xenforo and seeing if there is a way for it to utilize the memcached extension which would be necessary if you're running PHP 7.1.

Share this post


Link to post
Share on other sites

I was running this on a VPS and had it working with PHP 7.1 using port, with memcached.
There is a guide on cPanel site: https://forums.cpanel.net/threads/installing-memcache-and-memcached-with-easyapache4.566261/#post-2414091

Post 8, using a pecl module

Not sure if this something you would setup on a shared hosting, so just putting it out there, just incase.
 

 

Share this post


Link to post
Share on other sites

Looking at that guide they are installing the memcache extension not the memcached extension.  Unfortunately I don't foresee us offering it as an option after PHP 5.6 just due to the fact it was last updated in 2013: https://pecl.php.net/package/memcache  .  I don't foresee us offering the memcache extension in PHP 7.0 or 7.1 simply because even our vendors (cPanel, CloudLinux) are not doing it.

Share this post


Link to post
Share on other sites

Thanks for the reply.
I think I have sorted it, by using libmemcached, instead.
Could you check to see in the logs if it working am on ams201 - overclan?

$config['cache']['backend'] = 'Libmemcached';
$config['cache']['backendOptions'] = array(
    'compression' => false,
    'servers' => array(
        array(
            'host' => '/home/USERNAME/.hostdata/memcached.sock',
            'port' => 0,
        )
    )
);

Share this post


Link to post
Share on other sites

Looks like a similar solution to phpbb where they refer to the php memcached extension as Libmemcached.  As for checking if it's working you'd be best to open a ticket.  Although for most applications if it's not working they typically end up hanging or throwing an error.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now