View Full Version : FTP functions error
mthalavai
12-10-2007, 10:45 PM
I am using the ftp functions in my project and it is properly run in my local server. but the same script is not working in this client server. This server also have a dedicated ip address.
My Sample program
<?php
$ftp_server="server name";
$ftp_user="user name";
$ftp_pass="password";
echo "B4 connection";
$conn_id=ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
$login = ftp_login($conn_id,$ftp_user,$ftp_pass);
if(!$login){
echo "FTP Server connection has failed";
exit; }
else {
echo "Successful connection"; exit;}
?>
The above script is running upto the echo statement and not comes to the $conn_id definition line.
easypcle
12-19-2007, 10:15 AM
Hello mthalavai,
I'm having the same problem from with in a Perl CGI. It looks like the ftp connection request is timing out. As you said my script runs perfectly on my local machine.
I have raised a ticket but have as yet not heard anything back. Have you managed to resolve your problem?
-e
betiryan
12-19-2007, 10:17 AM
Don't submit a ticket. Use the blue live chat button - front page where you log into the c panel on the left. That's the way to get immediate attention.
MERRY CHRISTMAS!
Beti
http://vetstribute.com
Basil
12-19-2007, 10:29 AM
Wow, deja vu - http://www.bluehostforum.com/showthread.php?t=10960
I don't think I tried connecting to an ftp server outside the box because I didn't have one set up or whatever, it could very well be that we can't make connections on that port outside the server.
Alright, I can confirm that you can't connect to an ftp server off the box.
easypcle
12-19-2007, 10:42 AM
Basil,
I just tried connecting to my bluehost ftp site and the script worked fine.
I have also tried numerous external public ftp sites both in the States and UK without any success. So it looks like the port is blocked for outgoing traffic.
-e
Basil
12-19-2007, 10:46 AM
I don't have a dedicated IP address on my bluehost account, so I don't know if that makes a difference. Maybe somebody with one can confirm. I'm assuming it would..
easypcle
12-19-2007, 12:49 PM
Guys just to let you know and bring the issue to a close.
If you want to initiate an FTP connection from your site you will need a Dedicated IP
This costs $2.50 per month and is charged based on the length of your contract. So for instance I'm at the start of a 2 yr contract so thats $60 due now.
Beti Thanks for pointing me at the Live Chat, much better than raising tickets.
Thanks Guys
-e
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.