Just to let you know I find it is best to not use the system command line functions. My reason - I find that some servers just aren't compatible with these functions due to security policies and can even crash a server if the right settings are set on the server. So perhaps if you explain what you are trying to make the command do (like copying a movie) and I will try and find an alternative. I know the file_get_contents() and file_put_contents() are good for copying files on other servers.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
If you own a VPS (Virtual Private Server) like I do and really want to use those functions then you will need to find the security policies for php and set the security policies to allow php to interact with the core system. I think it's mainly a thing that's not enabled by default due to security reasons but I myself am not sure on how to enable these security policies. I'll google a bit for you to see if I can find such info.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
I read that making the following the code can sometimes work...
exec('youtube-dl http://www.youtube.com/watch?v=ZMhMZ8Ciyxw -o /home/video.flv');
exec('exit(0)');
Also I read that there is some setting in the php.ini file for the exec function but I can't seem to find it.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
Maybe php doesn't have the permissions to access the base of the home folder where as when you do it through the command terminal you are logged in as administrator. So try something like the following but replace the end address with the address to your web directory.
echo exec('youtube-dl http://www.youtube.com/watch?v=ZMhMZ8Ciyxw -o /home/user/public_html/video.flv');
So the public_html folder is the base of your website.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259