Skip to content

headers_sent() returns true in php-cli mode #842

@J-Cake

Description

@J-Cake

What happened?

I'm running (trying) to run NextCloud on FrankenPHP, which has been working for the most part, but when running the included Console script, I get a syntax error that there is content before the <?php section and should be removed. But there isn't.

Added by @withinboredom:

<?php

var_dump(headers_sent());

headers_sent() returns true in cli-mode.

Build Type

Official static build

Worker Mode

No

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

Please see [phpinfo.php](https://nextcloud.jschneiderprojects.au/phpinfo.php)

Please let me know when you have viewed this, so I can take it down

Relevant log output

$ docker exec -it jcake-nextcloud-1 frankenphp php-cli /app/occ files:scan
An unhandled exception has been thrown:
Exception: Config file has leading content, please remove everything before "<?php" in config.php in /app/lib/private/Config.php:257
Stack trace:
#0 /app/lib/private/Config.php(71): OC\Config->readData()
#1 /app/lib/base.php(150): OC\Config->__construct('/app/config/')
#2 /app/lib/base.php(622): OC::initPaths()
#3 /app/lib/base.php(1181): OC::init()
#4 /app/console.php(48): require_once('/app/lib/base.p...')
#5 /app/occ(11): require_once('/app/console.ph...')
#6 {main}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions