Bug #69118 [Opn]: exec command not executed.

From: Date: Sat, 04 Dec 2021 19:00:52 +0000
Subject: Bug #69118 [Opn]: exec command not executed.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238176@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69118&edit=1

 ID:                 69118
 Updated by:         bukka@php.net
 Reported by:        office at templenode dot com
 Summary:            exec command not executed.
 Status:             Open
 Type:               Bug
-Package:            FPM related
+Package:            Program Execution
 PHP Version:        5.4.38
 Block user comment: N
 Private report:     N

 New Comment:

I don't see how this is FPM related


Previous Comments:
------------------------------------------------------------------------
[2015-02-25 09:38:39] office at templenode dot com

Description:
------------
running a script with command /usr/bin/which does not work
create a file script.ph with the following, acces it trough web browser and see the result of
trace.txt

Test script:
---------------
<?php
$output = shell_exec('strace /usr/bin/which wget 2>> trace.txt');
echo "<pre>$output</pre>";
?>



Expected result:
----------------
getuid32()                              = 500
getgid32()                              = 500
geteuid32()                             = 500
getegid32()                             = 500
brk(0)                                  = 0x8de3000
brk(0x8e04000)                          = 0x8e04000
stat64("/usr/local/sbin/wget", 0xbf8b292c) = -1 ENOENT (No such file or directory)
stat64("/usr/local/bin/wget", 0xbf8b292c) = -1 ENOENT (No such file or directory)
stat64("/sbin/wget", 0xbf8b292c)        = -1 ENOENT (No such file or directory)
stat64("/bin/wget", 0xbf8b292c)         = -1 ENOENT (No such file or directory)
stat64("/usr/sbin/wget", 0xbf8b292c)    = -1 ENOENT (No such file or directory)
stat64("/usr/bin/wget", {st_mode=S_IFREG|0755, st_size=357936, ...}) = 0
getgroups32(64, [500])                  = 1
fstat64(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7709000
write(1, "/usr/bin/wget\n", 14)         = 14
exit_group(0)                           = ?




Actual result:
--------------
getuid32()                              = 500
getgid32()                              = 500
geteuid32()                             = 500
getegid32()                             = 500
write(2, "/usr/bin/which: no wget in ((nul"..., 36/usr/bin/which: no wget in ((null))
) = 36
exit_group(1)                           = ?




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=69118&edit=1


Thread (2 messages)

« previous php.bugs (#238176) next »