Edit report at https://bugs.php.net/bug.php?id=63567&edit=1
ID: 63567 Updated by: paj...@php.net Reported by: s...@php.net Summary: exec() always yields a 1 return code -Status: Open +Status: Feedback Type: Bug Package: Program Execution Operating System: Windows 7 x64 PHP Version: 5.5.0alpha1 Block user comment: N Private report: N New Comment: Can't reproduce it here. On which system or PHP version(s) does it happen exactly? Previous Comments: ------------------------------------------------------------------------ [2012-11-20 16:19:56] s...@php.net Description: ------------ Running exec() seems to detect a non-zero (and specifically 1) return code/exit code for the process. No matter what process. It also affects the proc_open class of functions so there is not even a decent workaround as far as we know. Works on my machine but @johmue on github has the issue consistently. He tried with all latest 5.2, 5.3 and 5.4, even 5.5-alpha1. They all do the same. Yet on my machine 5.4.8 works fine. At first sight I have exactly the same OS and PHP build that he does, so this makes no sense to me. There must be something wrong in his environment but we are not able to figure out what causes it. Note that trying the same thing in the shell directly yields a correct result, so the issue seems to be in php, for example this works: C:\>dir [snip] C:\>echo %errorlevel% 0 You can find the full thread below, but I tried to sum it up above: https://github.com/composer/composer/issues/613 Test script: --------------- C:\>php -r "exec('dir', $out, $ret);var_dump($ret);" Expected result: ---------------- int(0) Actual result: -------------- Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch. int(1) ---- Interstingly, it does output the wrong return code, and also prints this warning saying that the syntax of the filename/command is wrong. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63567&edit=1