Results 1 to 3 of 3

Thread: Beginner - PHP exec()

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    47

    Beginner - PHP exec()

    Hi

    Ive just installed Apache2 and php 5.15

    Im tyring to execure a command from php but im just getting a blank page:

    Code:
    <?php	
    echo exec('hostname')
    ?>
    Is there somehting missing in my php config? its really doing my head in!

    Nino

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Beginner - PHP exec()

    Have you checked out the manual

    http://uk.php.net/manual/en/function.exec.php

    You might need to change some of the setting in the php.ini file. Is it your server or a webhost?

  3. #3
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    266

    Re: Beginner - PHP exec()

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

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width