Using PHP how do I move a file from one server to another?
I have a php script that needs to move a file from one server to another server. They are both connected physically, and the firewall is configured to allow access. The local IP of the server I need to move the file to is 192.168.0.1
I know I need to use the rename command, but I don't know what path to use to reference the second server.
I know if this was a windows server I would map the folder where I want to move the file to, then in my page use the path to the folder, something like this //share-name/folder
Using NFS is how you access it directly. Or similar setups, such as Samba (same kind of thing, but NFS is usually easier to set up).
FTP won't inherently go outside the firewall. It's just like any other TCP connection in that it can easily go over your direct Ethernet cable connection. Just connect to the other computer via the IP address it has on that direct connection, and you're golden. If you're paranoid, tell the firewall to disallow outbound FTP connections and your FTP connection which won't go outside the firewall now can't.
I've only used Samba (because I've been on networks where the security issues of NFS were a problem, a situation that doesn't apply to you since you have only the two systems over a single direct cable), so I'm not sure if NFS needs to be installed or not; I was under the impression that it was part of every major *nix distro, but that seems not to be the case for you. Since you don't have the command, my instinct would be yes, you do have to install it.
Permissions need to be set the same way you would set them if you were moving between two directories on the same server. Essentially, using NFS you have made a particular subset of server B's filesystem a seamless part of server A's filesystem; in other words treat your NFS path just the same as you would any other directory on your server.
I've mounted the folder in this websites public_html folder, but I get permission denied when trying to move files into it using PHP. I thought since it was moving it to a folder inside the website it would be ok, do you have any idea how I need to do this?
All I can tell you is that the permissions on the folder need to be set to give your Apache user (or your PHP user if you're using su_exec or similar) write access to the directory. Try setting permissions to 777, and if that works start taking them away until it no longer works - the idea is that you want just enough permissions to let your script do what it needs to do and no more.