Skip to content

Redirecting STDOUT to a file no longer works in php8.x ?  #8835

@retry-the-user

Description

@retry-the-user

Description

This used to work in php7.x at least

<?php
fclose(STDOUT);
$STDOUT = fopen('/tmp/stdout.log', 'wb');

echo "test\n";

and you'd find "test" in the stdout.log file.

But this doesn't work anymore I guess. Is there a new way to redirect STDOUT to somewhere else?

Reference: phil_php at zieaon dot com 's comment from the page:
https://www.php.net/manual/en/features.commandline.io-streams.php

PHP Version

PHP 8.1.7

Operating System

No response

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