|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-12-04 19:00 UTC] bukka@php.net
-Package: FPM related
+Package: Program Execution
[2021-12-04 19:00 UTC] bukka@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 16:00:01 2025 UTC |
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) = ?