Page 1 of 1

Specify an alternative FTP port

Posted: Sun Aug 13, 2006 7:43 am
by Stringer
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


phpnoob (i dont in anyway claim to know what im talking about, I just copy and paste) looking for some help after seeing 147 results returned searching for my answer in this forums and still cant see it. 

I am setting up a stats php process called vspstats for our game server, the other 2 i did were using ftp port 21 as the originator of the php expected. This one I am doing now is only able to offer me port 22. My FTP client gets in there ok to see the data so now I need to know if I can modify the php that details the romte ftp connection to include the port number.

This is the existing code

Code: Select all

// Remote downloading of logs
    $cfg['ftp']['logs_path']= "./ftplogs/";        // Files downloaded from ftp server will go into this directory on local server.
    $cfg['ftp']['username'] = "xxx";
    $cfg['ftp']['password'] = "xxx";
    $cfg['ftp']['pasv'] = 1;                       // Enable(1)/Disable(0) Passive mode. Some FTP servers may require this to be ON
    $cfg['ftp']['overwrite'] = 0;                  // Enable(1)/Disable(0) overwriting of file(s). A value of 0 resumes the log.
Can I add a line like $cfg['ftp']['port'] = 22; to make it work?


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sun Aug 13, 2006 7:47 am
by volka
Not a general php but application related problem. And I never heard of vspstats before. Is there some kind documention?
Stringer wrote:Can I add a line like $cfg['ftp']['port'] = 22; to make it work?
did you try?

Posted: Sun Aug 13, 2006 8:09 am
by blackbeard
Port 22 is for SSH and SFTP. SFTP is a different protocol from FTP, and I don't think just changing the port number in your code will enable it to work.

Posted: Sun Aug 13, 2006 8:14 am
by Stringer
wow thx for fast response, there is but the site is down for re-design, I usually go there for my support *goes and checks the URL*
http://www.5th-gradient.com/vsp I just went to check it and its back up.
I see there an article suggesting using ftp://host.domainname:22/pathtodata/data.log\ in the run command instead of the usual ftp://host.domainname/pathtodata/data.log\ so I will try this to start with although it will be simpler for my user if I can embed the port in the PHP.

EDIT: the link works now, I did say Im noob! lol