I am trying to fetch video details as JSON using PHP exec()
I have youtube-dl
installed on my CentOS server.
Running youtube-dl -J <VideoURL>
via SSH
/Terminal
just works fine.
My test.php
script returns empty page :(
echo exec("youtube-dl -J <VideoURL>");
//Installed via pip
//OR
echo exec("python /home/site/youtube-dl -J <VideoURL>");
//Downloaded as file named youtube-dl
exec
is enabled if I test it like:
if(function_exists('exec')) {
echo "exec is enabled";
}
IP
of server is not blocked by YouTube as i am able to successfully run command via terminal