Nextcloud version (eg, 20.0.5): 27.0.1.2
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): 2.4.56
PHP version (eg, 7.4): PHP 8.1.21
The issue you are facing:
I had to switch server and I did a backup of my Nextcloud installation with tar and did a mysql dump of the database.
After I setup the new server I unpacked the tar.gz to the nextcloud folder and edited the config-file (‘datadirectory’ => ‘/var/www/clients/client1/web1/nextcloud/data’, Database etc.)
When I go to the domain, I get a 500 error. In the error.log I find this:
[Wed Jul 26 17:52:02.792819 2023] [proxy_fcgi:error] [pid 253531:tid 140056532109056] [remote 79.225.179.158:52666] AH01071: Got error 'PHP message: PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/clients/client4/web6/nextcloud/data/nextcloud.log) is not within the allowed path(s): (/var/www/clients/client1/web1/nextcloud:/var/www/clients/client1/web1/private:/var/www/clients/client1/web1/tmp:/var/www/nextcloud.bothsides.de/nextcloud:/srv/www/nextcloud.bothsides.de/nextcloud:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom) in /var/www/clients/client1/web1/nextcloud/html/lib/private/Log/File.php on line 61PHP message: PHP Warning: is_writable(): open_basedir restriction in effect. File(/var/www/clients/client4/web6/nextcloud/data) is not within the allowed path(s): (/var/www/clients/client1/web1/nextcloud:/var/www/clients/client1/web1/private:/var/www/clients/client1/web1/tmp:/var/www/nextcloud.bothsides.de/nextcloud:/srv/www/nextcloud.bothsides.de/nextcloud:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom) in /var/www/clients/client1/web1/nextcloud/html/lib/private/Log/File.php on line 64'
/var/www/clients/client4/web6/nextcloud/data
was the path of the old installation and I have no clue where I need to change this?
I searched in the database and found an entry in oc_storages
with the old path. I changed it but it didn’t help.
Open BaseDir is configuerd via ISPConfig: /var/www/clients/client1/web1/nextcloud:/var/www/clients/client1/web1/private:/var/www/clients/client1/web1/tmp:/var/www/nextcloud.bothsides.de/nextcloud:/srv/www/nextcloud.bothsides.de/nextcloud:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom
Open BaseDir was also configured on the old server, just with the path shown above.
Does anybody know how to solve this?
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
$CONFIG = array (
'instanceid' => 'xxxxxx',
'passwordsalt' => 'xxxxxx',
'secret' => 'xxxxxx',
'trusted_domains' =>
array (
0 => 'nextcloud.bothsides.de',
),
'datadirectory' => '/var/www/clients/client1/web1/nextcloud/data',
'dbtype' => 'mysql',
'version' => '27.0.1.2',
'overwrite.cli.url' => 'https://nextcloud.bothsides.de',
'dbname' => 'xxxx',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'xxxx',
'dbpassword' => 'xxxxx',
'installed' => true,
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'ssl',
'mail_sendmailmode' => 'smtp',
'mail_from_address' => xxxxx',
'mail_domain' => 'xxxx',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => 1,
'mail_smtphost' => 'xxxx',
'mail_smtpport' => '465',
'mail_smtpname' => 'xxx',
'mail_smtppassword' => 'xxxx',
'default_phone_region' => 'DE',
'memcache.local' => '\\OC\\Memcache\\APCu',
'maintenance' => false,
'theme' => '',
'loglevel' => 2,
'filelocking.enabled' => true,
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '127.0.0.1',
'port' => 6379,
'timeout' => 0.0,
'password' => '',
),
'opcache.save_comments' => 1,
'opcache.jit' => 1255,
'opcache.jit_buffer_size' => '128M',
);
Help is really appreciated.
Thanks,
Markus