I want to use curl in ssh with PHP and I did it, but program sometimes does not work in PHP.
I run this in ssh and it worked successfully:
curl -F video=@123.mp4 "https://example.com"
But when I write this code in PHP it is uploaded it but does not complete:
include('Net/SSH2.php');
$ssh = new Net_SSH2('ip');
if (!$ssh){
echo 'Error';
} else {
$ssh->login('username','password') or die("Login failed");
$ssh->exec('curl -F video=@123.mp4 "https://example.com"');
}
What is the problem?