echo system("/usr/bin/whoami", $ret);
echo $ret;
PHP 4.3.9 on Apache 2.0.52, CentOS 4.5. Safe mode is off, I can run programs as the apache user account from the command line, but all programs run from PHP fail with exit code 127.
echo system("/usr/bin/whoami", $ret);
echo $ret;
PHP 4.3.9 on Apache 2.0.52, CentOS 4.5. Safe mode is off, I can run programs as the apache user account from the command line, but all programs run from PHP fail with exit code 127.
/usr/bin/whoami
exists, and is executable (and readable, mode xx5
) by anyone.php.ini
on doc_root
and user_dir
, if those are set they can limit what you can execute.dmesg
or log files in /var/log/
.&$ret
instead of $ret
.exec()
and passthru()
, different functions might work for different situations.php.ini
for Apache, and a different one for cli use.