Find the answer to your Linux question:
Results 1 to 2 of 2
Hi guys! I have a php script that works and outputs info: <?php echo exec("uptime"); ?> and another that doesn't output anything: <?php echo exec("MP4Box"); ?> Why?...
  1. #1
    Just Joined!
    Join Date
    Apr 2011
    Posts
    1

    PHP exec() not working - Clues?

    Hi guys!

    I have a php script that works and outputs info:

    <?php
    echo exec("uptime");
    ?>

    and another that doesn't output anything:

    <?php
    echo exec("MP4Box");
    ?>

    Why?

  2. #2
    Linux Newbie
    Join Date
    Nov 2008
    Location
    Tokyo, Japan
    Posts
    243
    Maybe because "MP4Box" refuses to output anything when it is executed by a non-command-line program?

    Try executing this on the command line:
    Code:
    echo | MP4Box 2>&1 | cat
    Did you get any output on the command line? The output you see from that command should be exactly the output that will be returned to the PHP script.

    Otherwise, there may be some other problem, perhaps with permission -- the PHP server does not have permission to execute MP4Box, so it fails and returns no error.

    But I am only guessing.

Posting Permissions

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