0

$rt=passthru("/usr/bin/mediainfo ".$file );

echo $rt;

?> it doesn't show anything even if it works in the cli i have linux ubuntu OS . thanks for all

1 Answers1

0
  1. Make sure that you can call mediainfo anywhere, some shared hosting provider prevent this from happening, in that case define the full path where mediainfo binary is located, ej. /usr/bin/mediainfo, review your $PATH enviroment var. on PHP.
  2. make sure to pass the full path to the file to mediainfo and escape spaces and problematic characters.
  3. If you don't have to, don't close your PHP file with the last tag, ej:

file.php:

<?php
echo passthru('mediainfo file.mp3');
// last line, no closing tag needed.
Rodrigo Polo
  • 4,314
  • 2
  • 26
  • 32
  • Thanks for your reply Rodrigo ! but still doesn't work it doesn't display anything (blank page) not even an error or a message . the full path to mediainfo is /usr/bin/mediainfo and the full path to the file is also correct i chekced it . i tried to use ffmpeg by the same way and it worked fine, still don't understand why !!! – user3703962 Aug 10 '14 at 20:03