PHP exec / shell_exec / system does not work through browser

I am running a Unix SCO block with apache version 1.3.33 and PHP version 4.4. I can correctly execute the exec command through cli, but ran into difficulties when trying to execute the script through the browser. My settings:

  • safe mode is off
  • full read / write / execute permissions
  • display all errors
  • no disabled features

My code: test_script.php in htdocs dir

<?php
exec('ls',$out,$rval);
echo "Output:<hr />";
print "<pre>"; print_r($out); print "</pre>";
echo "Return Value:<hr />";
echo $rval;
?>

I also tried installing an executable binary path. The script test is the same user / group as apache. I also tried adding 2> & 1 to arg, but don't see the changes. Thank you in advance.

See here for the likes.

+3
source share
2 answers

to try

$output = shell_exec('ls /tmp/ 2>&1')

, -.

whoami.

+6

, php.ini

0

All Articles