PHP Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in xxxx/lib/public/IConfig.php on line 36

Steps to reproduce

  1. Open ownCloud Instance in Browser

Error: Fatal error : Namespace declaration statement has to be the very first statement or after any declare call in the script in /xxxx/lib/public/IConfig.php on line 36

Server configuration

Operating system:

**Web server: Apache

Database:

**PHP version: PHP 7.1

ownCloud version: 10.0.10

**Updated from an older ownCloud or fresh install: from older major stable - The instance ran for several months without any problems.

Most probably this is an app breaking the instance, or a broken upgrade ā€¦ or possibly some other issue. For analyzing we need some more information

Please provide at least the following information as it was stated in the original template:

List of activated apps:

ownCloud log (data/owncloud.log):
-> especially those lines around the message you posted: Namespace declaration statement ā€¦

So for starting, Iā€™d recommend to disable all apps, which were not shipped with ownCloud and try again. Then, re-enabling one app after the other you might find the one which is breaking your setup. If an app is the reason.

Is occ working? What is the result after having run
sudo -u www-data php occ integrity:check-core

From which older stable did you upgrade?

1 Like