{"record":{"id":"1b92a481cc42f3b7","repo":"symfony/process","slug":"output-has-been-disabled","errorCode":null,"errorMessage":"Output has been disabled.","messagePattern":"Output has been disabled\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"Process.php","lineNumber":1412,"sourceCode":"\n        ob_start();\n        phpinfo(\\INFO_GENERAL);\n\n        return self::$sigchild = str_contains(ob_get_clean(), '--enable-sigchild');\n    }\n\n    /**\n     * Reads pipes for the freshest output.\n     *\n     * @param string $caller   The name of the method that needs fresh outputs\n     * @param bool   $blocking Whether to use blocking calls or not\n     *\n     * @throws LogicException in case output has been disabled or process is not started\n     */\n    private function readPipesForOutput(string $caller, bool $blocking = false): void\n    {\n        if ($this->outputDisabled) {\n            throw new LogicException('Output has been disabled.');\n        }\n\n        $this->requireProcessIsStarted($caller);\n\n        $this->updateStatus($blocking);\n    }\n\n    /**\n     * Validates and returns the filtered timeout.\n     *\n     * @throws InvalidArgumentException if the given timeout is a negative number\n     */\n    private function validateTimeout(?float $timeout): ?float\n    {\n        $timeout = (float) $timeout;\n\n        if (0.0 === $timeout) {\n            $timeout = null;","sourceCodeStart":1394,"sourceCodeEnd":1430,"githubUrl":"https://github.com/symfony/process/blob/99b85026db14a68f02c6f3eeb01a1170ca25c491/Process.php#L1394-L1430","documentation":"When a Process is created with disableOutput() (or null callback + disabled output), all output-reading APIs are forbidden. readPipesForOutput() checks outputDisabled first and throws a LogicException because there is no pipe data to read by design.","triggerScenarios":"Calling getOutput(), getErrorOutput(), getIncrementalOutput(), getIncrementalErrorOutput() or iterating getIterator() after $process->disableOutput() (or after passing disableOutput via constructor options).","commonSituations":"Disabling output for performance in background jobs but later needing stdout for debugging; copy-pasted code reading output of a fire-and-forget process.","solutions":["Remove disableOutput() if output is needed (must be before start)","Check $process->isOutputDisabled() before reading","If output is genuinely unneeded, drop the getOutput()/getIterator() calls"],"exampleFix":"// before\n$process->disableOutput();\n$process->start();\necho $process->getOutput();\n// after\n$process->start();\necho $process->getOutput();","handlingStrategy":"validation","validationCode":"if ($process->isOutputDisabled()) {\n    throw new LogicException('Output is disabled; cannot read output.');\n}","typeGuard":null,"tryCatchPattern":"try { $out = $process->getOutput(); } catch (LogicException $e) { $out = null; }","preventionTips":["Only call disableOutput() when you will never read output","Check isOutputDisabled() before any read API","Prefer keeping output enabled unless profiling shows pipe overhead matters"],"tags":["php","process","output-disabled"],"backgroundTag":"unsupported-operation","analyzedSha":"99b85026db14a68f02c6f3eeb01a1170ca25c491","analyzedAt":"2026-09-14T11:23:33.683Z","contentChangedAt":"2026-09-14T11:23:33.683Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}