{"record":{"id":"1be0fa26e33d466d","repo":"symfony/process","slug":"unable-to-create-temporary-ini-file","errorCode":null,"errorMessage":"Unable to create temporary ini file.","messagePattern":"Unable to create temporary ini file\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"PhpSubprocess.php","lineNumber":98,"sourceCode":"        throw new LogicException(\\sprintf('The \"%s()\" method cannot be called when using \"%s\".', __METHOD__, self::class));\n    }\n\n    /**\n     * @param (callable('out'|'err', string):void)|null $callback\n     */\n    public function start(?callable $callback = null, array $env = []): void\n    {\n        if (null === $this->getCommandLine()) {\n            throw new RuntimeException('Unable to find the PHP executable.');\n        }\n\n        parent::start($callback, $env);\n    }\n\n    private function writeTmpIni(array $iniFiles, string $tmpDir): string\n    {\n        if (false === $tmpfile = @tempnam($tmpDir, '')) {\n            throw new RuntimeException('Unable to create temporary ini file.');\n        }\n\n        // $iniFiles has at least one item and it may be empty\n        if ('' === $iniFiles[0]) {\n            array_shift($iniFiles);\n        }\n\n        $content = '';\n\n        foreach ($iniFiles as $file) {\n            // Check for inaccessible ini files\n            if (($data = @file_get_contents($file)) === false) {\n                throw new RuntimeException('Unable to read ini: '.$file);\n            }\n            // Check and remove directives after HOST and PATH sections\n            if (preg_match('/^\\s*\\[(?:PATH|HOST)\\s*=/mi', $data, $matches, \\PREG_OFFSET_CAPTURE)) {\n                $data = substr($data, 0, $matches[0][1]);\n            }","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/symfony/process/blob/99b85026db14a68f02c6f3eeb01a1170ca25c491/PhpSubprocess.php#L80-L116","documentation":"Thrown from PhpSubprocess::writeTmpIni when tempnam() fails to create the temporary php.ini file in the system temp dir (called during construction). Without this file the subprocess cannot be configured with the parent's INI settings.","triggerScenarios":"Thrown at PhpSubprocess.php:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the system temporary directory exists and is writable","Check disk space and permissions for the temp directory","Point sys_get_temp_dir() to a writable location via TMPDIR/TMP/TEMP"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}