New install with memcached problems

9.0.x
help

#1

I have an existing owncloud server, but it's pretty basic SQLlite and all. I've started trying to get a totally new and clean install of owncloud with all MariaDB and mem cahcing.

I've been following this guide
https://www.tombrossman.com/blog/2016/install-owncloud-9-on-ubuntu-16.04/

However, I'm stuck at the memcache part. After editing the config.php file to include

'memcahce.local' => '\OC\Memcahce\Memcached',
'memcache.distributed' => '\OC\Memcached\Redis',
'memcache.locking' => '\OC\Memcahce\Redis',
'redis' =>
array (
'host' => 'localhost',
'port' => 6379,
'timeout' => 0,
'dbindex' => 0,
'password' => 'SOME PASSWORD',
),

I restart apache and owncloud doesn't seem to be working, I can run ./occ and I get this (instead of the menu full of options)

root@server:/var/www/owncloud# sudo -u www-data ./occ
An unhandled exception has been thrown:
Error: Class '\OC\Memcached\Redis' not found in /var/www/owncloud/lib/private/Memcache/Fa ctory.php:100
Stack trace:
0 /var/www/owncloud/lib/private/Server.php(333): OC\Memcache\Factory->__construct('55013 83efa7310f...', Object(OC\Log), '\OC\Memcache\Nu...', '\OC\Memcached\R...', '\OC\ Memcahce\Re...')
1 /var/www/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\ {closure}(Object(OC\Server))
2 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Co ntainer->offsetGet('MemCacheFactory')
3 /var/www/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleC ontainer->query('MemCacheFactory')
4 /var/www/owncloud/lib/private/Server.php(950): OC\ServerContainer->query('MemCacheFact ory')
5 /var/www/owncloud/lib/base.php(804): OC\Server->getMemCacheFactory()
6 /var/www/owncloud/lib/base.php(553): OC::registerAutoloaderCache()
7 /var/www/owncloud/lib/base.php(967): OC::init()
8 /var/www/owncloud/console.php(50): require_once('/var/www/ownclo...')
9 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')

Commenting out the lines in config.php the server works great, with them in, nothing.

just to make sure (because at this point i wasn't) i checked to see if memcached was there

root@server:/var/www/owncloud# systemctl status memcached.service
● memcached.service - memcached daemon
Loaded: loaded (/lib/systemd/system/memcached.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2016-07-22 21:47:48 EDT; 20min ago
...

Looks like it's there and working
and redis

root@server:/var/www/owncloud# systemctl status redis
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2016-07-22 21:47:52 EDT; 31min ago
...

I read the one post titled "Problems using redis with socket for filelocking" because that was the only other post about redis and memcahce, but it really didn't seem to help

Any help or advice, or other how-to's to follow would be great help. Thanks for the help in advance


#2

Looks like there is something missing. Did you enable the php-redis module (put a testfile.php with <?php phpinfo(); ?> into you document root, there you can see all the enabled modules in php.

there are two typos! And memcache needs a little more (https://doc.owncloud.org/server/9.0/admin_manual/configuration_server/caching_configuration.html):

'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Memcached',
'memcached_servers' => array(
array('localhost', 11211),
array('server1.example.com', 11211),
array('server2.example.com', 11211),
),

With a single server (and no cluster) you won't need memcache.distributed, and the recommended combination is redis for file-locking and APCu (php-apcu) as local cache:
https://doc.owncloud.org/server/9.0/admin_manual/configuration_server/caching_configuration.html#small-organization-single-server-setup


#3

Thanks for the help.

I really hope those typos are the problem :stuck_out_tongue:

I was trying to follow the actual owncloud config guide, but the chaching using APCu seems kinda hand-wavy. I tried that first on a separate clean install but I never got it working either. It says that on PHP 5.5 and up APCU is installed and enabled by default, but I added the memcahce line to config.php and owncloud barfed and i got similar errors. That's when i went looking for a more complete how-to that had more detail on the caching setup.

I'm kinda new to web based programs and I wasn't familiar with the phpinfo() way of checking to see enabled modules. I will definitely check that out. Checking php aside, for the small, single server installations is there anything else you need to do to get APCu working, other than the one line in config.php?

Thanks again for the help and great reply!


Weblogin nicht möglich - Danke fürs Lesen!
#4

Yes, you also need APCu version 4.0.6+ as stated in the linked documentation above.

Even if the small, single server installation doesn't recommend Redis as the memcache.locking i would also install this after you got APCu for memcache.local running (Also note the version requirement for redis on this page).


#5

Thanks for all the help RealRancor and tflidd!!

Fixed the typo and did change to using APCu (which i did look for before, but somehow missed the php-apcu package)

Got the server totally up and running!

Thanks again for the help