2015-06-07 26 views
-1

这是try.php命令行文件shell_execute(''youtube-dl')NOT WORKING .browser显示NULL。为什么?

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

php try.php给了我下面的

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 
[email protected]:/usr/bin# 

,但是当我在网页浏览器上运行

它显示 enter image description here

+0

去为libav工具的升级方法,这是其他几个包取决于相反的,让我们使用'--prefer-ffmpeg''YouTube的-dl'之后。这将告诉编码器使用'ffmpeg'而不是'avconv'。我刚刚测试过它,它似乎在Ubutu 14.04 TLS的开箱即用安装方面运行良好。 – Ohgodwhy

+1

这是什么问题?为什么警告,或者为什么浏览器中没有输出? –

+0

为什么浏览器中没有输出? – sky

回答

1

添加以下行到您了shell_exec():

LD_LIBRARY_PATH = ''

对于实施例片段:

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

及其一个python问题。即使我有同样的问题。

这将修复它