{"record":{"id":"e6f1635d78330381","repo":"symfony/process","slug":"invalid-option-s-passed-to-s-supported-options-are-s","errorCode":null,"errorMessage":"Invalid option \"%s\" passed to \"%s()\". Supported options are \"%s\".","messagePattern":"Invalid option \"(.+?)\" passed to \"(.+?)\\(\\)\"\\. Supported options are \"(.+?)\"\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"Process.php","lineNumber":1264,"sourceCode":"     *\n     * @see https://php.net/proc_open for the options supported by PHP.\n     *\n     * Enabling the \"create_new_console\" option allows a subprocess to continue\n     * to run after the main process exited, on both Windows and *nix\n     */\n    public function setOptions(array $options): void\n    {\n        if ($this->isRunning()) {\n            throw new RuntimeException('Setting options while the process is running is not possible.');\n        }\n\n        $defaultOptions = $this->options;\n        $existingOptions = ['blocking_pipes', 'create_process_group', 'create_new_console'];\n\n        foreach ($options as $key => $value) {\n            if (!\\in_array($key, $existingOptions)) {\n                $this->options = $defaultOptions;\n                throw new LogicException(\\sprintf('Invalid option \"%s\" passed to \"%s()\". Supported options are \"%s\".', $key, __METHOD__, implode('\", \"', $existingOptions)));\n            }\n            $this->options[$key] = $value;\n        }\n    }\n\n    /**\n     * Defines a list of posix signals that will not be propagated to the process.\n     *\n     * @param list<\\SIG*> $signals\n     */\n    public function setIgnoredSignals(array $signals): void\n    {\n        if ($this->isRunning()) {\n            throw new RuntimeException('Setting ignored signals while the process is running is not possible.');\n        }\n\n        $this->ignoredSignals = $signals;\n    }","sourceCodeStart":1246,"sourceCodeEnd":1282,"githubUrl":"https://github.com/symfony/process/blob/99b85026db14a68f02c6f3eeb01a1170ca25c491/Process.php#L1246-L1282","documentation":"Symfony Process throws this LogicException when an unsupported option key is passed to setOptions(). Only 'blocking_pipes', 'create_process_group' and 'create_new_console' are recognized; any other key restores the previous options and throws immediately so typos fail fast.","triggerScenarios":"Calling $process->setOptions([...]) with a key not in ['blocking_pipes','create_process_group','create_new_console'], e.g. 'timeout', 'env', or a misspelled option like 'create_new_consoles'.","commonSituations":"Copy-pasting options from another library (symfony/process options vs proc_open flags), typos in option names, upgrading Symfony where option names changed, confusion between constructor options and runtime setters.","solutions":["Use only supported keys: blocking_pipes, create_process_group, create_new_console","Check the exact spelling against the $existingOptions array in Process.php","Move non-option settings to their dedicated setters (setTimeout, setEnv, etc.)"],"exampleFix":"// before\n$process->setOptions(['timeout' => 30]);\n// after\n$process->setTimeout(30);\n$process->setOptions(['create_new_console' => true]);","handlingStrategy":"validation","validationCode":"$allowed = ['blocking_pipes','create_process_group','create_new_console'];\n$invalid = array_diff(array_keys($options), $allowed);\nif ($invalid) { throw new InvalidArgumentException('Unknown options: '.implode(',', $invalid)); }\n$process->setOptions($options);","typeGuard":null,"tryCatchPattern":"try { $process->setOptions($opts); } catch (LogicException $e) { /* fix option keys */ }","preventionTips":["Keep a whitelist constant of valid option keys","Use named constructor/helper wrapping setOptions","Check Symfony Process docs for supported options per version"],"tags":["php","process","invalid-option"],"backgroundTag":"invalid-enum-value","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"}