-1

I have a game server running in a vps with centos 6 .
The game server stores its status data on a text file and i want to access this file from my website server with php.
The problem is that it is better to do it without installing something link ftp server on the vps. Also i do not know how to set the ftp account directory to my game server directory.
Anyone knows any other simpler way to do so ?
Thanks.

Farhan
  • 96
  • 2
  • 11
  • 1
    Do you have any kind of webserver installed on your vps? (like apache or node+express)? – RDardelet Jul 14 '16 at 14:44
  • Unfortunately no. And it is better to resolve the problem without installing a web server or at least resolving it by installing a simple software that uses less ram. Thanks – Farhan Jul 14 '16 at 14:50

2 Answers2

1

Use a client which supports SFTP if you are able to connect to your server via SSH.

phpseclib handles the SFTP connection without the need to install an extension. For an example on how to download a file with SFTP go here.

Fairy
  • 3,592
  • 2
  • 27
  • 36
  • this is not an answer , firstly it is an comment, and second thing op said ,`i do not know how to set the ftp account directory` – Arsh Singh Jul 14 '16 at 14:45
  • @ArshSingh FTP is not SFTP. The second question is related to a ftp server which you don't have to use if you use SFTP. – Fairy Jul 14 '16 at 14:47
  • @Fairy Thank you. But my website is in a web hosting that does not allows ssh. – Farhan Jul 14 '16 at 14:53
  • @f.n174 But your game server allows SSH. You can use PHP to open a SFTP connection to your game server and download the file from there. – Fairy Jul 14 '16 at 14:56
1

If you don't have a webserver installed on your vps, you can use an sftp connection with php, check this question to help you implement it.

sFTP being available by default on most linux OSs you shouldn't have much trouble doing this;

Community
  • 1
  • 1
RDardelet
  • 564
  • 3
  • 11