doushuo2834 2014-06-25 06:52
浏览 87
已采纳

rsync没有权限由php触发

I'm trying to sync two local folders by triggering rsync from a php script. The following error is produced:

rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(992) [sender=2.6.9]
rsync: recv_generator: mkdir "/Library/xxxxxxx" failed: Permission denied (13)

How do I give php/apache permissions to trigger the rsync process?

Thanks!

  • 写回答

2条回答 默认 最新

  • dongyou26216708 2014-06-25 06:56
    关注

    The problem is that you do not have permissions to create directory.

    Use chown on directory /Library and assign to the same user that is executing Apache server, and give permission of 755 to all files and directories, for example, if the user executing Apache is daemon:

    sudo chown daemon.daemon -R /Library
    sudo chmod 755 -R /Library
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?