Skip to content

Commit a30aa5a

Browse files
committed
Show error in child process if exec fails (in proc_open)
1 parent 73c15e0 commit a30aa5a

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
@@ -1095,7 +1095,9 @@ PHP_FUNCTION(proc_open)
10951095
}
10961096
}
10971097

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

0 commit comments

Comments
 (0)