views:

314

answers:

3

I have WAMP 2.0 installed and am working on a content management system using PHP and MySQL. Is it possible to use the PHP FTP functions on my local machine, so I can test them?

Thanks! Mike

A: 

Yes - but you need to run an FTP server. Microsoft IIS used to ship with one many years ago - but I'm not sure about current versions - but there are freeware / GPL / shareware products available.

symcbean
A: 

Is it possible to use the PHP FTP functions on my local machine

Yes it is. It should be enabled by default in your WAMP installation. You can easily test these functions. The following will connect to an FTP server and print the directory listing:

$con = ftp_connect($server) or die("Couldn't connect"); 
ftp_login($con,  $username,  $password);
print_r(ftp_nlist($con, "."));
ftp_close($con);
webbiedave
Where do I find what my username and server name are? I don't recall setting one up. Since my hostname is localhost, would the server name be ftp.localhost.com?
letseatfood
Oh. You mean *connect* to a server on your local machine. You will need to install one. Use FileZilla Server: http://filezilla-project.org/download.php?type=server Then try the code provided and use localhost as the server.
webbiedave
Thanks, I had just done this, per icio's recommendation below. I am using the port number (?) as the host name and it is working.
letseatfood
+1  A: 

Yes. You can use PHP's FTP functions from your local machine. If you are wanting to test these functions by connecting to an FTP server on your local machine then you will need to set one up. I believe that there's a FileZilla Server which would get you up and running with that, but I couldn't testify to it's quality.

icio
Thanks! That was the problem. It is almost working now.
letseatfood