Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cache:clear shows many invalid characters, unicode characters in webpage, ANSI cached files, etc #22972

Closed
@patrickvane

Description

@patrickvane
Q A
Bug report? yes
Feature request? no
Symfony version 3.2.0+

Cache:clear as well as cache:warmup have a weird output (see screenshot).

In several projects the webpages (in prod or dev environment) show many unicode characters, followed by an error stating that the headers have already been send (see screenshot).

Every file is UTF8 without BOM, except for var/cache/prod/annotations.php, which is ANSI, and which sends the headers. The file is also not executed (throw Exception('test') in it doesn't do anything). web/app.php is executed (echo's in it are visible, above the unicode mess), and the controller action is also executed (echo's are displayed after the unicode mess).

These errors don't happen in 3.1.*, but do happen in 3.2.0 and beyond.

The way to quickly test it is this:

php composer create-project symfony/framework-standard-edition TestProject "3.2.0"
cd TestProject
SET SYMFONY_ENV=prod
php composer install --no-dev --optimize-autoloader
php bin/console cache:clear --env=prod --no-debug

If the cache:clear produces many random characters, as in the screenshot, then it has bugged.

The screenshots:

error_01
The webpage in 3.2.* in production (production, debian 8 server)

error_02
The error in sentry (production, debian 8 server)

error_03
Grep to see which php file starts with something else than <?php
(caused by ANSI encoding of annotaitons.php file)
(production, debian 8 server)

error_04
Content of var/cache/prod/annotations.php
(production, debian 8 server)

error_05
Output of cache:clear with 3.2.0,
(development, win 7 pc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions