Help Please! Nextcloud not running anymore

I tried to run occ and I got this:
An unhandled exception has been thrown:
ParseError: syntax error, unexpected ‘array’ (T_ARRAY), expecting ‘)’ in /var/www/nextcloud/config/config.php:7
Stack trace:
#0 /var/www/nextcloud/lib/private/Config.php(59): OC\Config->readData()
#1 /var/www/nextcloud/lib/base.php(131): OC\Config->__construct(’/var/www/nextcl…’)
#2 /var/www/nextcloud/lib/base.php(607): OC::initPaths()
#3 /var/www/nextcloud/lib/base.php(1092): OC::init()
#4 /var/www/nextcloud/console.php(48): require_once(’/var/www/nextcl…’)
#5 /var/www/nextcloud/occ(11): require_once(’/var/www/nextcl…’)
#6 {main}root@admin01-Latitude-E6410:/var/www/nextcloud#

After that I cannot access my nextcloud anymore! Gives me error 500
Somebody please help!
I was only trying to follow the instructions to get rid of the /nextcloud/index.php/


https://doc.owncloud.org/server/9.1/admin_manual/configuration_server/index_php_less_urls.html#configuration-steps
https://doc.owncloud.org/server/9.1/admin_manual/configuration_server/occ_command.html

Hi,

Can you post the content of /var/www/nextcloud/config/config.php?
Especially the lines around 7 will be interesting.

Can you pls post your config.php

Why would you need the config.php file?
It only contains the server address and the login credentials.

becaue it seems that you’ve made a mistake there
especially in lines around 7

replace your login credentials / server adress with " ***** "

Currently it’s something like this
array
0==localhost
1==internal ip of server
2==public ip: port
I need someone else to help me do the mapping to domain name tonight
thought it would be great to get rid of the /nextcloud/index.php/ now

You can redact your address and passwords. There seems to be a syntax error. Other config.php’s won’t help you because all the credentials, salts, … are different and won’t work like this on other machines.

$CONFIG = array (
‘instanceid’ => ‘111111111111111111111111111’,
‘passwordsalt’ => '111111111111111111111111111,
‘secret’ => ‘11111111111111111111111111111111111’,
‘trusted_domains’ => ''
array (
0 => ‘localhost’,
1 => 'internal ip,
2 => ‘public ip:port’,
),
‘datadirectory’ => ‘/var/www/nextcloud/data’,
‘overwrite.cli.url’ => ‘http://localhost/nextcloud’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘11.0.0.10’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘111111111111111’,
‘dbpassword’ => '11111111111111111,
‘logtimezone’ => ‘UTC’,
‘installed’ => true,
);

you’ve forgot a ’ in this line

–> 1 => ‘internal ip’,

I accidentally deleted it here because I was clearing the ips
But the original one has it.

should look like this (without the quotes after =>):

'trusted_domains' =>
array (
0 => 'localhost',
1 => 'internal ip',
2 => 'public ip:port',
),

edit: closing quotes on the dbpassword and passwordsalt values are missing as well (typos?)

1 Like

Yeah, those are typos
I just deleted the quote sign after trusted domains
still not working…

Then post the new error message please

It’s back now!
Thank you tflidd !!!
I think there’s 2 ’ s after it and I only deleted one of them
You are awesome!

There you should rather use a public hostname, because when links are generated or send out, localhost won’t be accessible anywhere but on the server itself.

Do you have a static ip? If not you should consider using a dyndns-service to have a hostname that does not change.

I remember there is an owncloud support document teaching how to go from www.example.com/owncloud/ to www.example.com/
But somehow I cannot find it now.

If you want to get rid of the index.php you can also have a look here: https://www.youtube.com/watch?v=yqr22XG8P4w

Thanks a lot, I will try again.
Do you know if there is a similar document that teaches how to get rid of nextcloud/?
Either my eyes are playing tricks on me after 2 days without sleeping… or the article just disappeared…

Yes I have static IP, I won’t even consider running nextcloud without it.

Not sure if there is an article. For nginx they provide two configurations one with and one without subdirectory.
On apache you normally would just change the DocumentRoot to /var/www/nextcloud and remove Alias /nextcloud "/var/www/nextcloud/" from your webserver-config. But please open a new topic if you have a problem here and provide more information about the webserver used and your current configuration.