You may missed the ; at the end of the line.

<?php
echo exec('hostname'); // ; may missed
?>