PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Your first site likely doesn't have permission to write to the directories of the second site. This is a good thing, don't fight it. You could set up an FTP uploading account for the second site that uses php's ftp functionality to transfer the file across.
What I'm suggesting is a special account that only has access to the folder into which you want to drop the files, nothing more. This way, even if your first site becomes compromised, the root level password for site2 isn't available for abuse.