Hi,
I've been trying to execute some system commands and print back the
output on the webpage. I found the following code to do so, however,
it is not working.
<?php
echo exec('whoami');
?>
I get following errors in my /var/log/messages
Dec 24 12:03:34 melville kernel: audit(1103889814.948:0): avc: denied
{ read } for pid=13794 exe=/usr/sbin/httpd name=sh dev=hda2
ino=670441 scontext=root:system_r:httpd_t
tcontext=system_u:object_r:bin_t tclass=lnk_file
Apache server is ran by user apache and the .php file is also owned by
user apache.
Apache is not running in Safe_Mode
safe_mode Off Off
safe_mode_exec_dir /var/www/html/sh /var/www/html/sh
safe_mode_gid Off Off
safe_mode_include_dir /var/www/html /var/www/html
However, i tried to switch on the Safe_Mode but that wasn't any good either.
Any idea how can i get it work?
Thanks,
Zia
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php