From 5e8d84467857d341edc2728285e054e7e370a01d Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 14 Feb 2013 12:11:15 +0100 Subject: [PATCH] [Process] Warn user with a useful message when tmpfile() failed --- src/Symfony/Component/Process/Process.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 4af26e85a2..7f065efe26 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -213,6 +213,9 @@ class Process $this->fileHandles = array( self::STDOUT => tmpfile(), ); + if (false === $this->fileHandles[self::STDOUT]) { + throw new RuntimeException('A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable'); + } $this->readBytes = array( self::STDOUT => 0, );