Changing the TCP-port fixed this one.
Beiträge von NogNeetMachinaal
-
-
Not out of the box, because for netcup webhostings the paths to the data directory in the SSH console and in a web process are different.
So, to cope with that, you have to use a solution like e.g. this one.
Perhaps true (and I'm overlooking something) - but if I add that config file to the config-folder, then nextcloud as whole becomes unavailable. It complains about folder rights and a missing file called ".ocdata". So I removed it.
-
This morning, I tried a manual upgrade with this install:
- Nextcloud main: /httpdocs/some.host.de/main
- Nextcloud data: /httpdocs/some.host.de/data
- Nextcloud tmp: /httpdocs/some.host.de/tmp
I renamed the current ../main-folder to ../main-2022jan8
Then uploaded nextcloud.zip containing the next new version.
This was then extracted to the folder ../nextcloud.
After which it was renamed to ../main.
I then connected to some.host.de and it suggested an upgrade through the web interfaces.
Which was granted (of course). After a suggested retry it completed succesfully.
Once this was completed and I did a new login, the Nextcloud-server suggested another upgrade.
Which was started and completed without any manual interference.
Meaning nothing else was done from my end (other then a confirmation on using the webui for the upgrade).
At this time I have a running nextcloud with semi-automatic updates and no running errors in the log.
Meaning there is only an error when clicking on system info.
The for me relevant settings in config.php:
Code'datadirectory' => '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/some.host.de/data', 'tempdirectory' => '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/some.host.de/tmp', 'overwrite.cli.url' => 'https://some.host.de/',The underlying webhosting package is Webhosting 2000
Thank you for the support and patience.
-
I installed "Nextcloud Hub II (23.0.0)" on Webhosting 4000.
I have similar settings, but I do not have a tmp folder in httpdocs and no tmp folder in httpdocs/domain.example/cloud/nextcloud.
My data folder is: httpdocs/domain.example/cloud/nextdata.
Updates work ... upload works ... and there are no error messages in the log file

Interesting - it looks like you have the data folder stored outside of the nextcloud install?
You/helpy:
Nextcloud main: httpdocs/domain.example/cloud/nextcloud
Nextcloud data: httpdocs/domain.example/cloud/nextdata
Me/NogNeetMachinaal:
Nextcloud main: httpdocs/nc.it-visibility.net
Nextcloud data: httpdocs/nc.it-visibility.net/data
Will give that a try.
Thank you
=====
Edit: tried that with (no improvements):
Nextcloud main: /httpdocs/nc.it-visibility.net/main
Nextcloud data: /httpdocs/nc.it-visibility.net/data
Here, no changes for the data-dir in config.php.
Also tried with:
Nextcloud main: ../httpdocs/nc.it-visibility.net/
Nextcloud data: ../nc/data
The config.php had then the following data-dir:
'datadirectory' => '/var/www/vhosts/hosting160002.a2f36.netcup.net/nc/data',
Previously this was:
'datadirectory' => '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data',
The last one made matters worse. The login screen says:CodeYour data directory is invalid Ensure there is a file called ".ocdata" in the root of the data directory. Cannot create "data" directory This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/21/go.php?to=admin-dir_permissionsSo I reverted all the changes back to the previous one with main and data.
helpy | I'm not sure how the next question will be experienced... but still... is there a way where I can have a view on your webhosting- and nextcloud settings?
-
Hi,
sound like a connection problem
Please double check the wp-config.php especially the database server IP and the identifier – it’s almost always WP_ almost ?
If all this does not help – backup your old WP through a plugin, create a fresh installation and import the backup.Best regards
You where correct - connection problem => wrong TCP-port in the wp-config-file...

-
Go to phpmyadmin in WCP and check the names of db and dbuser. (Really the same as in wp_config?) Password really correct?
Also look into the db, if there is any content.
Ommit the port at the host in wp_config. Use only the ip of the DB-server (not the ip of the webserver)
EDIT:
And better use mysqli_connect_errno() to check if the connection could be established.
I used the wrong portnumber in the wp-config-file...

-
If this really works, it can only be a config error in wordpress. What about server log files, are there any errors listed? Enabling wordpress debug logs could be helpful aswell.
The debugging showed what I was overlooking all along: used TCP-port 3360 in the config-file - no where else...
Now working as expected.
Thank you for your time and patience - Will
-
I tried your test code - it only seems to work, but a real sql query does not work.
Here is a full test:
PHP
Alles anzeigen<?php $dbname = '<dbname>'; $dbuser = '<username>'; $dbpass = '<userpassword>'; $dbhost = '10.35.xxx.xxx'; $link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); mysqli_select_db($link, $dbname) or die("Could not open the db '$dbname'"); $test_query = "SHOW TABLES FROM $dbname"; $result = mysqli_query($link, $test_query); var_dump($result);The result must be an mysqli object, not null/false.
If this really works, it can only be a config error in wordpress. What about server log files, are there any errors listed? Enabling wordpress debug logs could be helpful aswell.
This php-script is giving me "bool(false)" - nothing else?
To double-check: I get the same result on the one of the other websites => the ones that are working as expected.
The php-script is below => looks very much the same as yours?
PHP
Alles anzeigen<?php $dbname = 'k163835_some_username'; $dbuser = 'k163835_some_username'; $dbpass = 'some_secret'; $dbhost = '10.35.47.55'; $link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); mysqli_select_db($link, $dbname) or die("Could not open the db '$dbname'"); $test_query = "SHOW TABLES FROM $dbname"; $result = mysqli_query($link, $test_query); var_dump($result); ?> -
but you created the /tmp directory?
Can you pls. post the full error message?Thank you for getting back on this - really appreciated!
Yes - the tmp-folder is there - see attached screenshot from the file manager.
As far as starting the update process goes: there is no error => it goes straight back to the dashboard.
Perhaps there is more in debug mode. But until now, I didn't see anything - even when setting 'debug' => true in the config.php file. Hoever, to be honest - this debug-part is a grey area => I may have missed things here...
As for the open_basedir issue: every few seconds, the same 2 messages pop-up - see the code block with "Error log 1".
The content of each message is the same - see the code block with "Error log 2" and "Error log 3".
Not sure if the error log under /logs/nc.it-visibility.net has anything to do with it (see code block with "Error log 4").
Tried with debug-mode on => no extra results.
=====
forum.netcup.de/system/attachment/7930/nextcloud-folder content.png
Code
Alles anzeigenError log 1 Error PHP Error: is_file(): open_basedir restriction in effect. File(/l10n/en.js) is not within the allowed path(s): (/var/www/vhosts/hosting160002.a2f36.netcup.net/:/tmp/:/var/lib/php/sessions) at /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Template/ResourceLocator.php#106 2022-01-08T12:01:58+0100 Error PHP Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/var/www/vhosts/hosting160002.a2f36.netcup.net/:/tmp/:/var/lib/php/sessions) at /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Template/Base.php#68 2022-01-08T12:01:58+0100 Error PHP Error: is_file(): open_basedir restriction in effect. File(/l10n/en.js) is not within the allowed path(s): (/var/www/vhosts/hosting160002.a2f36.netcup.net/:/tmp/:/var/lib/php/sessions) at /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Template/ResourceLocator.php#106 2022-01-08T12:00:50+0100 Error PHP Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/var/www/vhosts/hosting160002.a2f36.netcup.net/:/tmp/:/var/lib/php/sessions) at /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Template/Base.php#68 2022-01-08T12:00:50+0100Code
Alles anzeigenError log 2 [PHP] Error: Error: is_file(): open_basedir restriction in effect. File(/l10n/en.js) is not within the allowed path(s): (/var/www/vhosts/hosting160002.a2f36.netcup.net/:/tmp/:/var/lib/php/sessions) at /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Template/ResourceLocator.php#106 at <<closure>> 0. <<closure>> OC\Log\ErrorHandler::onError(2, "is_file(): open ... )", "/var/www/vhosts ... p", 106, {root: false,fil ... e}) 1. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Template/ResourceLocator.php line 106 is_file("/l10n/en.js") 2. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Template/JSResourceLocator.php line 91 OC\Template\ResourceLocator->appendIfExist(false, "l10n/en.js", false) 3. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Template/ResourceLocator.php line 79 OC\Template\JSResourceLocator->doFind("l10n/en") 4. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/TemplateLayout.php line 365 OC\Template\ResourceLocator->find(["core/js/dist/m ... "]) 5. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/TemplateLayout.php line 193 OC\TemplateLayout::findJavascriptFiles(["core/js/dist/m ... "]) 6. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/legacy/OC_Template.php line 183 OC\TemplateLayout->__construct("user", "settings") 7. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/public/AppFramework/Http/TemplateResponse.php line 210 OC_Template->fetchPage({forms: {persona ... "}) 8. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/AppFramework/Http/Dispatcher.php line 172 OCP\AppFramework\Http\TemplateResponse->render() 9. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/AppFramework/App.php line 157 OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings\Con ... {}, "index") 10. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Route/Router.php line 302 OC\AppFramework\App::main("OCA\\Settings\\ ... r", "index", OC\AppFramework\ ... {}, {section: "loggi ... "}) 11. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/base.php line 993 OC\Route\Router->match("/settings/admin/logging") 12. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/index.php line 37 OC::handleRequest() GET /index.php/settings/admin/logging from 141.101.104.92 by Will at 2022-01-08T11:58:12+01:00Code
Alles anzeigenError log 3 [PHP] Error: Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/var/www/vhosts/hosting160002.a2f36.netcup.net/:/tmp/:/var/lib/php/sessions) at /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Template/Base.php#68 at <<closure>> 0. <<closure>> OC\Log\ErrorHandler::onError(2, "file_exists(): ... )", "/var/www/vhosts ... p", 68, {theme: "",app: ... e}) 1. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Template/Base.php line 68 file_exists("/templates/") 2. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/legacy/OC_Template.php line 147 OC\Template\Base->getAppTemplateDirs("", "core", "/var/www/vhosts ... t", false) 3. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/legacy/OC_Template.php line 89 OC_Template->findTemplate("", "core", "layout.user") 4. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/TemplateLayout.php line 92 OC_Template->__construct("core", "layout.user") 5. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/legacy/OC_Template.php line 183 OC\TemplateLayout->__construct("user", "settings") 6. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/public/AppFramework/Http/TemplateResponse.php line 210 OC_Template->fetchPage({forms: {persona ... "}) 7. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/AppFramework/Http/Dispatcher.php line 172 OCP\AppFramework\Http\TemplateResponse->render() 8. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/AppFramework/App.php line 157 OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings\Con ... {}, "index") 9. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/private/Route/Router.php line 302 OC\AppFramework\App::main("OCA\\Settings\\ ... r", "index", OC\AppFramework\ ... {}, {section: "loggi ... "}) 10. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/lib/base.php line 993 OC\Route\Router->match("/settings/admin/logging") 11. /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/index.php line 37 OC::handleRequest() GET /index.php/settings/admin/logging from 141.101.104.92 by Will at 2022-01-08T12:01:58+01:00CodeError log 4 [Fri Jan 07 21:45:18.412588 2022] [core:crit] [pid 1405] (13)Permission denied: [client 141.101.76.57:32910] AH00529: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/' is executable [Sat Jan 08 10:46:40.077212 2022] [access_compat:error] [pid 17499] [client 141.101.76.183:35698] AH01797: client denied by server configuration: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/config [Sat Jan 08 11:52:28.817008 2022] [core:crit] [pid 14483] (13)Permission denied: [client 141.101.105.83:46956] AH00529: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/' is executable [Sat Jan 08 12:12:33.013475 2022] [core:crit] [pid 24511] (13)Permission denied: [client 141.101.104.92:32924] AH00529: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/' is executable [Sat Jan 08 12:12:54.871065 2022] [core:crit] [pid 24566] (13)Permission denied: [client 141.101.104.92:33822] AH00529: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/' is executable -
I am wondering that you can even connect to your db with
mysqli_connect('<host>:<port>', '<database-name>', '<password>');
because the syntax for mysqli_connect is:
mysqli_connect('<host>', '<user-name>', '<password>', '<database-name>', '<port>');
I know for sure that the port number defaults to 3306.
I'm not sure about the database name - perhaps it just connects to the database service?
And doesn't access the database at all?
Or connects to some "default" database?
While writing... just tried with adding the database name and port number => same result.
-
I don't use my webspace account that much, but your webroot is
have you set the tmp directory on your NC config?
Thank you for the webroot-clarrification - makes sense.
Didn't have the temp-dir in the config => just did => still no working update process.Also added a few other directory directives (templates & skeleton) => no improvements
-
Hey,
What do you mean with "connection problem"?
How differs the Wordpress connection from the php-script?
Database server and identifier match.
What plugin would you recommend?
Thank you - Will
-
Hi Everyone,
Recently, I copied an existing Wordpress website; including its underlying database.
I then created a new DNS-domein, copied the website content to this httpdocs-root, created a new database and imported the existing database.
The next step was adjusting the Wordpress-config file to use the newly imported database.
In addition, modified the database table where the URL is stored.
However - when trying to access this "new" website, it returns " Error establishing a database connection".
When I try accessing the same database via a small php-script (see below), it returns "connected succesfully".
The source-website is working as expected.
What am I overlooking here?
=====
-
Alles anzeigen
the Open_basedir is a security instrument from PHP, handling the files php and thereby also nextcloud is allowed to access.
You can edit the preferences in your webhosting backend under PHP Settings.
It seems as if you have stored your data outside the root directory - what you should do

But php is not allowed to access them.
The updater might have the same problem – or is missing a writable tmp directory!
Nextcloud on an webhosting account is a little challenge, a VPS or Root Server would be the better alternative
Thank your the quick response.
I know Nextcloud on a webhosting account can be challenging - but still - it is a php application like Wordpress and all those others... should be doable...(?)
I know about the PHP-settings in the back-end and tried a few things - no improvements.
The docroot-variable says:
"/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/"
So I guess the webspaceroot-variable is "httpdocs/nc.it-visibility.net/"?
The domain nc.it-visibility.net is a subdomain of it-visibility.net.
Perhaps that is messing things up - at least to some extend?
Currently the php-setting for open_basedir says:
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}{/}var{/}lib{/}php{/}sessions
There is a tmp-folder in httpdocs and in httpdocs/nc.it-visibility.net/.
Also tried with a temp-folder (for no particular reason).
But the remaining things... what (for example) is /var/lib/php/sessions for?
Any suggestions on what these settings should/could be like for nextcloud?
-
I have two issues with Nextcloud – not sure if they are related.
One is when opening the updater it brings me back to the openingsscreen (i.e. no update).
The other is about lots of errors in the log – all starting with “Error: is_file(): open_basedir restriction in effect.”.
Anyone a suggestion what to do with either of these?
Thank you – Will
-
Thank you for the tip.
Does that also apply for webhosting? How do I make that happen?
-
Still one message I'm struggling with:
"Last background job execution ran 8 days ago. Something seems wrong. Check the background job settings"
Tried with the option webcron and cron => no improvements.
Any suggestions?
-
If this wasn't your Windows device who "restored" things via the Nextcloud client and you also don't know whose Windows device it is, it might be wise to start over from scratch.
Yes - it was my Windows device and me doing a manual restore of a backup to the sync-folder of the Nextcloud client.
-
First: thank you for your prompt response, time and patience - really appreciated.
It is 0755 for both - all files and folders in /httpdocs - including /httpdocs itself.
However, the data directory keeps returning to "rwx rwx ---"
To summarize: I checked and made some changes as suggested. But no noticable improvements.
It looks like I (or somebody else?) was able to fix most of the things by deleting all folders and files from the webUI and then restored them via the Nextcloud client of a Windows device.
Regarding the phrase "somebody else?": a few changes where made to the config.php file... and it wasn't me...

To whoever made these: thank you!
There are a few leftovers in the section called "Security & setup warnings".
Will make an attempt fixing these using the RTFM and RTFMT approach...

-
What are the permissions of the file /httpdocs/nc.it-visibility.net/data/.htaccess and the data directory?
- Default permissions for files: 0644 (rw-r--r--)
- Default permissions for directories: 0755 (rwxr-xr-x)
First: thank you for your prompt response, time and patience - really appreciated.
It is 0755 for both - all files and folders in /httpdocs - including /httpdocs itself.
However, the data directory keeps returning to "rwx rwx ---"
To summarize: I checked and made some changes as suggested. But no noticable improvements.