سؤال

I'm using Unison to sync files between two servers. I'm trying to get PHP to call it after a file is uploaded.

I'm using exec, but it's returning an error code of 2.

exec("/usr/bin/unison /var/www/html/files ssh://a2//var/www/html/files -batch -prefer newer -times -path uploads", $out, $r);

$out is a blank array, and $r is 2. What does an error code of 2 mean?

P.S. I ran php -a on the command line, and copied and pasted that line, and it worked. Also, exec('whoami') works (and is the same user I was logged in as on the command line).

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top