PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 29th, 2012, 12:36 PM
Bryan.ray Bryan.ray is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 6 Bryan.ray User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 32 m 19 sec
Reputation Power: 0
PHP5 - Connecting to ftp server and getting a list

Hello group.
I'm trying to connect to a ftp server and I'm not able to connect. I'm getting the Could not connect to nhc.noaa.gov.
Here's the code I'm using. Appreciate any suggestions. I've also tried using the IP address with the same result.

PHP Code:
 $ftp_path="nhc.noaa.gov";
$conn ftp_connect($ftp_path) or die("Could not connect to $ftp_path");
$ftp_user_name"anonymous";
$ftp_user_pass"someone@gmail.com";
$login_result ftp_login($conn$ftp_user_name$ftp_user_pass);
ftp_chdir($conn"/atcf/aid_public/");

print_r (ftp_rawlist($conn,"."));

ftp_close($conn); 


Using google chrome, I can go to the url without a problem and get the file list.
Thanks for any suggestions.
Bryan

Reply With Quote
  #2  
Old September 29th, 2012, 10:52 PM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,805 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 17 h 43 m 13 sec
Reputation Power: 6112
Quote:
Using google chrome, I can go to the url without a problem and get the file list.
You sure about that? I can't hit that FTP site with PHP, chrome, or an FTP client.
__________________
HEY! YOU! Read the New User Guide and Forum Rules

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

Reply With Quote
  #3  
Old September 30th, 2012, 09:23 AM
Bryan.ray Bryan.ray is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 6 Bryan.ray User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 32 m 19 sec
Reputation Power: 0
Quote:
Originally Posted by ManiacDan
You sure about that? I can't hit that FTP site with PHP, chrome, or an FTP client.


Yes, here's the link to the site for use in a browser. I'm not allowed to post links so I mangled it a little to show.

ftp :// ftp. nhc. noaa. gov/ atcf/ aid_public/

Regards,
Bryan

Reply With Quote
  #4  
Old September 30th, 2012, 09:30 AM
ptr2void ptr2void is offline
I haz teh codez!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Dec 2003
Posts: 2,476 ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 2 Days 6 h 20 m 11 sec
Reputation Power: 2194
From your original post:

Quote:
php Code:
Original - php Code
  1. $ftp_path="nhc.noaa.gov";


From the link you provided:

Quote:
ftp://ftp.nhc.noaa.gov/ atcf/ aid_public/


Don't you see the difference?
__________________
I ♥ ManiacDan & requinix

This is a sig, and not necessarily a comment on the OP:
Please don't be a help vampire!

Reply With Quote
  #5  
Old September 30th, 2012, 10:02 AM
Bryan.ray Bryan.ray is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 6 Bryan.ray User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 32 m 19 sec
Reputation Power: 0
Quote:
Originally Posted by ptr2void
From your original post:



From the link you provided:



Don't you see the difference?


Thanks for the reply. Yes, I've tried every variation of the domain name with ftp in front, not in front etc...
Right now, I cannot even get to the ftp site again with my browser, but I could 30 minutes ago. Maybe there is a DNS issue. I've even tried to ping the ftp. nhc. noaa. gov site and do not get a response, but I do get a response from nhc. noaa. gov. Same situation with filezilla. It is hit and miss on connecting.

Would it be too much to ask to copy the code on your machine and run it to see if it works? Sorry if I'm asking too much... I know people's time is important....
Thanks for any other suggestion you might have.

Reply With Quote
  #6  
Old September 30th, 2012, 07:42 PM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,805 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 17 h 43 m 13 sec
Reputation Power: 6112
Quote:
Would it be too much to ask to copy the code on your machine and run it to see if it works?
That's how I discovered that the server you're trying to hit isn't responding. Note that I even said I couldn't do it in PHP.

If the site is down, FTP won't work.

Changing to ftp_connect('ftp.nhc.noaa.gov'); worked for me, again from PHP.

Reply With Quote
  #7  
Old September 30th, 2012, 09:11 PM
Bryan.ray Bryan.ray is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 6 Bryan.ray User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 32 m 19 sec
Reputation Power: 0
Quote:
Originally Posted by ManiacDan
That's how I discovered that the server you're trying to hit isn't responding. Note that I even said I couldn't do it in PHP.

If the site is down, FTP won't work.

Changing to ftp_connect('ftp.nhc.noaa.gov'); worked for me, again from PHP.


Reading your response earlier, I do see you said you tried the script...
Thanks for your help. Still no luck on my end with the script and the browser is very intermittent ... Seems like IE connects occasionally, but no luck with Chrome.
Hopefully this is a weekend maintenance thing with the server and not an ongoing problem.
Thanks again,
Bryan

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP5 - Connecting to ftp server and getting a list

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap