title: Shell Command in PHP file : Display the content of a file in a webpage
body: <p>I need some help, how can I execute a shell command in a php file? on how to display the content of a file in a webpage.</p>
  
  <p>I tested this script, it works </p>
  
  <pre><code>&lt;?php
  $output = shell_exec('ls /var/www/vhosts/resame');
  echo "&lt;pre&gt;$output&lt;/pre&gt;";
  ?&gt;
  </code></pre>
  
  <p>but this script, did not display anything.</p>
  
  <pre><code>&lt;?php
  $output = shell_exec('cat /var/log/mail.log');
  echo "&lt;pre&gt;$output&lt;/pre&gt;";
  ?&gt;
  </code></pre>