Memcache or Memcached?

    • 89 posts
    February 8, 2022 2:27 AM EST
    Hi all,

    I've installed Memcached, it's loaded into PHP it shows up on PHP info yet it's creating an error and stopping the tasks from running.

    PHP Fatal error: Uncaught Zend_Cache_Exception: The memcache extension must be loaded for using this backend ! in

    Now I've searched and searched and tried multiple things but it still doesn't work, the only thing I can think of is the error States 'memcache' which is the name of the older PHP module yet all references on 5.8 SE refer to it in its updated name Memcached

    Is this a bug? Has anyone ever got Memcached to work correctly? If so how?

    I was using file based caching but kept getting a Zend error every so often about falling to write, a few people have mentioned the same error but the trail goes dead with no solutions.

    • Moderator
    • 6923 posts
    February 10, 2022 4:49 AM EST

    I've tested this on my local on 5.9.0 and not having any issues with it. We did used to use it on the community as well but we don't use it now. Can you check with your host perhaps? The zend error seems odd too. Are your permissions fine?

    • 89 posts
    February 10, 2022 3:00 PM EST

    Found the issue! After hours and days of trauma!

    In the SocialEngine Task scheduler I have had to run a cron job as the other options do not work for me,

    The page says add this to the cron:

    echo $(php -f '/var/application/cli.php' 'controller=utility,action=tasks,key=o1CILLXWTIVyxtyq,notrigger=1') 2>&1 >> '/var/temporary/log/tasks.log'

    I'm running my own VPS with Plesk so it has many PHP versions you can use, obviously I have to use the outdated PHP 7.2

    This part of the code :

    echo $(php -f

    and I'm no server expert so don't judge me lol is running the php for the ACTUAL Plesk installation...

    I did not install memcached there, I installed it on the php 7.2 that my site is running so I needed to add the directory to that php compiler and in plesk for 7.2 the code is now:

    echo $(/opt/plesk/php/7.2/bin/php -f

     

    tested it and woohoo it works finally!

     

    I was reading a post on the Plesk forum, unrelated but gave me an idea so in SSH I ran the command php -m

    and it didn't display the Memcached module installed then I looked back at the cron job code and realised the issue... it's now fixed hurrah!

    • Moderator
    • 6923 posts
    February 11, 2022 5:06 AM EST

    Thank you for providing the fix you found.It helps others who may have the same issue.