Solved

ftp cunctions

Posted on 2009-06-28
4
281 Views
Last Modified: 2015-01-05
I use wampserver program to make localhost and I try this code
<?php
$conn = ftp_connect('192.168.4.2',21,3) or die("Could not connect");
?>
but the connection failed
why ??????
0
Comment
Question by:mega-scorpion
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 39

Expert Comment

by:Roger Baklund
ID: 24731658
Are you running a ftp server on 192.168.4.2? Port 21? Is the firewall open for this port? Have you tried increasing the timeout?

Try connecting with a "normal" ftp client to eliminate some sources for errors.
0
 
LVL 14

Accepted Solution

by:
profya earned 500 total points
ID: 24731960
If you are targeting your localhost (192.168.4.2) then it is expected to fail if you are only rely on wampserver, since the wampserver does not come with an FTP service. For this to work for you you need to install and configure an ftp server or using IIS FTP if you prefer, it is easy to run and administer.
Please refer to this http://www.wampserver.com/phorum/read.php?2,38316 for more information.
0
 
LVL 11

Expert Comment

by:BrianMM
ID: 24734551
also check your firewall...

if the address exists unless firewall either your end or their end is blocking it what you have should work.
0
 
LVL 14

Expert Comment

by:profya
ID: 24734795
May be you need to increase the timeout, 3 is not enough as I think. You can use the default 90 seconds or more, depending on the traffic on the network:
ftp_connect('192.168.4.2',21,120)
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question