Skip to content

Could not open input file: should be sent to stderr #11141

Closed
ThePHPF/thephp.foundation
#90

Description

@mvorisek

Description

Repro command: php non-existent.php

Currently the output (Could not open input file: non-existent.php) is sent to stdout but it should be sent to stderr instead.

I have discovered when using php for interprocess communication where the stdout might be consumed as regular data causing protocol failure hard to understand, as in my case, only the first 4 bytes were consumed (and from Coul it was hard to identify the problem). Simply said, stdout should never contain any other data then data printed by a valid script.

Activity

  1. NattyNarwhal commented on Apr 29, 2023

    @NattyNarwhal
    Member

    Looks like php_printf is used a bit in main/ and SAPIs for this - and if we're counting sundry diagnostic information, even more in extensions and Zend/. It probably shouldn't.

  2. iluuu1994 commented on Apr 29, 2023

    @iluuu1994
    Member

    Switching to STDERR should be fine. U fortunately, the error messages seem to be quite inconsistent with where they are printed.

  3. added a commit that references this issue on Jul 19, 2024
    ac5920f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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