Access problem to own cloud



Good morning, giving the command:

Blockquote/ var / www / owncloud # sudo -u www-data php occ files: scan --all

I receive this message:

BlockquotePHP Warning: fopen(/var/www/owncloud/config/config.php): failed to open stream: Permission denied in /var/www/owncloud/lib/private/Config.php on line 252
PHP Warning: flock() expects parameter 1 to be resource, boolean given in /var/www/owncloud/lib/private/Config.php on line 262
An unhandled exception has been thrown:
Exception: Could not acquire a shared lock on the config file /var/www/owncloud/config/config.php in /var/www/owncloud/lib/private/Config.php:263
Stack trace:
#0 /var/www/owncloud/lib/private/Config.php(65): OC\Config->readData()
#1 /var/www/owncloud/lib/base.php(134): OC\Config->__construct(’/var/www/ownclo…’)
#2 /var/www/owncloud/lib/base.php(517): OC::initPaths()
#3 /var/www/owncloud/lib/base.php(997): OC::init()
#4 /var/www/owncloud/console.php(64): require_once(’/var/www/ownclo…’)
#5 /var/www/owncloud/occ(11): require_once(’/var/www/ownclo…’)

typing IP / owncloud address the page remains white …


what are the permissions on the config.php file?

do you have file locking enabled?


$CONFIG = array (
‘maintenance’ => false,
‘instanceid’ => ‘ocyap2d6r37y’,
‘passwordsalt’ => ‘VvoDAZqD2XNv+rOKNoi1BPgL9ILRqE’,
‘secret’ => ‘DWu+9riKG5e0ybLsCvrG9ioJOVGonV44vpVx5KXQA6+n9WbG’,
‘trusted_domains’ =>
array (
0 => ‘192.168.x.xx’,
‘datadirectory’ => ‘/mnt/data’,
‘overwrite.cli.url’ => ‘http://192.168.x.xx/owncloud’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘’,
‘dbname’ => ‘owncloud’,
‘dbhost’ => ‘localhost’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘gianluca’,
‘dbpassword’ => ‘xxx’,
‘logtimezone’ => ‘UTC’,
‘installed’ => true,
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘redis’ => [
‘host’ => ‘localhost’,
‘port’ => 6379,
‘memcache.locking’ => ‘\OC\Memcache\Redis’, // Add this for best performance

this are my config.php


Yeah, that’s not what I have asked.

the permissions have to be set to give the web server user, in ubuntu ist’s www-data for apache, the ownership to your config.php file.

this can be done with this command:

chown www-data:www-data /var/www/owncloud/config/config.php

also you have the redis configuration not quite right. please read the documentation and adjust your settings.
the documentation is available at

You can try to comment out the redis configuration and check if the error persists.


ok, giving the command posted I managed to log in :slight_smile: now check some documentation regarding redis configuration. Thank you

a curiosity … I do not understand the reason for the error received giving the command of the scan file … I had not touched anything in the configuration …