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: -
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: FPM related
PHP Version: 5.4.38 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Dec 17 02:01:26 2018 UTC