Search code examples
phpapachersync

Rsync via PHP exec() with SSH passwordless ssh login


If I run the command via php exec(): It does not work. But if I use bash, it runs perfect. Any idea what the problem might be.? I was thinking maybe it is executing rsync as apache and not allowing ssh login.

exec('rsync -au /var/www/html/f1/ [email protected]:/var/www/html/f2/');

Solution

  • Since none of the above suggestions would work, I had to allow the Apache user account passwordless access to the server I needed to upload images too. It works like I charm, just as needed, Thank you to all that attempted to help with my issue.