0

this is try.php file

<?
      echo shell_exec('youtube-dl https://yotube.com?xxxxxx');
?>

on command line php try.php gives me the following

WARNING: Your copy of avconv is outdated and unable to properly mux separate video and audio files, youtube-dl will download single file media. Update avconv to version 10-0 or newer to fix this.
[youtube] 5Zq5wjkJ_Es: Downloading webpage
[youtube] 5Zq5wjkJ_Es: Extracting video information
[youtube] 5Zq5wjkJ_Es: Downloading DASH manifest
root@vps:/usr/bin#

but when i run on web browser

it shows enter image description here

sky
  • 183
  • 1
  • 1
  • 15
  • Instead of going the upgrade approach for libav-tools, which several other packages depend on, let's use `--prefer-ffmpeg` after `youtube-dl`. This will tell the encoder to use `ffmpeg` as opposed to `avconv`. I've just tested it and it seems to work fine on an out of the box installation of Ubutu 14.04 TLS. – Ohgodwhy Jun 07 '15 at 16:33
  • 1
    What's the question? Why the warning, or why no output in browser? – Alexander O'Mara Jun 07 '15 at 16:40
  • why no output in browser? – sky Jun 07 '15 at 16:48
  • 2
    Why no output: Short tags, not enabling error reporting, not redirecting stderr `2>&1`, incorrect PATH setup, and youtube-dl does not send videos to stdout per default. – mario Jun 07 '15 at 16:50
  • atleast it should echo something – sky Jun 07 '15 at 16:52
  • 1
    It doesn't output anything because it's standard error, not standard output. Check out [PHP - How to get Shell errors echoed out to screen](http://stackoverflow.com/questions/15086572/php-how-to-get-shell-errors-echoed-out-to-screen) – Alexander O'Mara Jun 07 '15 at 16:55
  • var_dump() shows NULL. what should i do – sky Jun 07 '15 at 17:01
  • Look at the `2>&1` that was appended to the command, it redirects standard error to standard output. – Alexander O'Mara Jun 07 '15 at 17:28
  • python: relocation error: python: symbol OpenSSL_add_all_digests, version OPENSSL_1.0.0 not defined in file libcrypto.so.1.0.0 with link time reference – sky Jun 07 '15 at 17:46
  • @AlexanderO'Mara He is facing a Python related issue – Akash Chauhan Jun 08 '15 at 22:15

1 Answers1

1

ADD the following line to your shell_exec():

LD_LIBRARY_PATH=''

For Example snippet :

shell_exec("LD_LIBRARY_PATH='' youtube-dl https://yotube.com?xxxxxx");

Its a python problem. Even i had the same problem.

It will fix it

Akash Chauhan
  • 232
  • 1
  • 8