Update owncloud fail on UBUNTU 16.04


#1

Hi,
when I try to run occ with www-data user (ie sudo -u www-data php occ upgrade) I get the following message :
"PHP Warning: require_once(): open_basedir restriction in effect. File(/var/www/owncloud/console.php) is not within the allowed path(s): (/dev/urandom) in /var/www/owncloud/occ on line 12
PHP Warning: require_once(/var/www/owncloud/console.php): failed to open stream: Operation not permitted in /var/www/owncloud/occ on line 12
PHP Fatal error: require_once(): Failed opening required '/var/www/owncloud/console.php' (include_path='.:/usr/share/php') in /var/www/owncloud/occ on line 12"
I try to find by myself but now I have no idea. And you?
thanks
best regards

Expected behaviour

With a operational owncloud I update with official depots and synaptic automatic update. when I use the the https site and the update fail.

Actual behaviour

I try using occ as I say before

Server configuration

Operating system:
ubuntu 16.04 uptodate
Web server:
apache2
Database:
mysql
PHP version:
7.0.22
ownCloud version: (see ownCloud admin page)
10.3
Updated from an older ownCloud or fresh install:
9.1.6.2
Where did you install ownCloud from:
http://download.owncloud.org/download/repositories/stable/Ubuntu_17.04/


#2

I did the following search https://www.google.com/search?q=open_basedir+restriction+in+effect and found https://stackoverflow.com/questions/223800/how-can-i-relax-phps-open-basedir-restriction or https://www.templatemonster.com/help/open_basedir-restriction-in-effect-filex-is-not-within-the-allowed-paths-y.html which seems to me that those are quite thoroughly explain what to do when facing such a misconfigured PHP environment.


#3

thanks for your advices, but for now I dont find the bug. my configuration before the update worked fine.
I try again to understand the wrong configuration.
regards
Philippe


#4

I found a solution but I am not sure It's a good one

In my php.ini (cli directory) I comment the line open_basedir = /dev/random. I can update without mistake but in Hardening and Security Guidance It's advice to keep this.

I am going to found a better solution.

Best regard
Philippe


#5

I think you should review my posted links which are telling you how to configure the open_basedir correctly.