0
votes

I am maintaining two local servers on local network (within the office premises).

One is the server where my php files are being located and another server is a File Server where I want to store all the uploaded files. As the second one is a file server so there should no need to install php on that server.

How I can upload the files to another server. I have the full rights to access the file server. I tried to use ftp_connect() method. But that is not working in Intranet however, it is perfectly working with any live server ftp credentials.

If I use CURL then I have to install PHP on my file server, but that is not a good practice. So how I can upload the files using php ftp related methods?

How I can upload the files to file server. Thanks in advance.

1
it'd be useful if you told us what operating systems are on these servers - for local operations there's far more efficient protocols than httpd/ftp you could use, e.g. NFS or SMBMarc B
On File server, CentOS is installed and on the server where my PHP files are located, Open Suse is installed.Arun Jain
Perhaps you have not setup the ftpd correctly or your not connecting to the correct ip.Lawrence Cherone
As if I am trying to connect with any public ip then ftp_connect() method is working fine but not in intranet. How I can do that and also should I also have to configure Openssh in case if I am using ssh2_connect()?Arun Jain

1 Answers

0
votes

Since in your case both client and server are Unix systems, the easiest is to mount a directory of the file server on the web server by NFS. This way you can upload files by copying or moving them locally, no need to muck around with FTP or SSH modules in PHP.