Skip to content

Commit 3dabfa9

Browse files
committed
Show error in child process if exec fails (in proc_open)
1 parent 492d79d commit 3dabfa9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/standard/proc_open.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,9 @@ PHP_FUNCTION(proc_open)
10961096
}
10971097
}
10981098

1099-
/* Show errors from exec!! */
1099+
/* If execvp/execle/execl are successful, we will never reach here
1100+
* Display error and exit with non-zero (error) status code */
1101+
php_error_docref(NULL, E_WARNING, "Exec failed - %s", strerror(errno));
11001102
_exit(127);
11011103
} else if (child < 0) {
11021104
/* failed to fork() */

0 commit comments

Comments
 (0)