php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69118 exec command not executed.
Submitted: 2015-02-25 09:38 UTC Modified: 2021-12-04 19:00 UTC
Votes:3
Avg. Score:2.7 ± 1.2
Reproduced:2 of 3 (66.7%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: office at templenode dot com Assigned:
Status: Open Package: Program Execution
PHP Version: 5.4.38 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: office at templenode dot com
New email:
PHP Version: OS:

 

 [2015-02-25 09:38 UTC] 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)                           = ?



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-12-04 19:00 UTC] bukka@php.net
-Package: FPM related +Package: Program Execution
 [2021-12-04 19:00 UTC] bukka@php.net
I don't see how this is FPM related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 13 13:01:27 2024 UTC