Web Hosting Forum | Lunarpages

Author Topic: PHP's ftp_nlist() Function Returns Boolean False  (Read 1586 times)

Offline kiusau

  • Space Explorer
  • ***
  • Posts: 6
PHP's ftp_nlist() Function Returns Boolean False
« on: April 22, 2017, 01:57:41 PM »
Recently I logged into my FTP account remotely with ftp_ssl_connect() and ftp_login().  The connection succeeded, and I was able to obtain my current directory with the ftp_pwd() function -- namely '/'.  This is where everything came to a complete halt.  Using ftp_nlist($resource_id, '/') I was unable to view my directory.  I tried with passive FTP turned on and off.  Both modes failed.

Code: [Select]
$result = ftp_nlist($ftp_talk, '/');
var_dump($result);

Has anyone else experienced similar difficulty?

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6207
Re: PHP's ftp_nlist() Function Returns Boolean False
« Reply #1 on: April 22, 2017, 03:48:59 PM »
Googling php ftp_nlist, I see a lot of situations similar to yours. Something often suggested to fix it is to add ftp_pasv() to activate passive mode.

Why it used to work and doesn't now? Sounds like LP changed a setting somewhere, or maybe something changed between your PC and your server.
Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-

Offline kiusau

  • Space Explorer
  • ***
  • Posts: 6
Re: PHP's ftp_nlist() Function Returns Boolean False
« Reply #2 on: April 22, 2017, 04:21:47 PM »
For me, ftp_nlist() has never worked, and changing from passive to non-passive mode does not help.  In contrast, I have no trouble corresponding between my local server and the Lunarpages server via the FTP protocol using FETCH.  What technology FETCHSoftworks uses remains a mystery.

 :welcome:
Roddy

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6207
Re: PHP's ftp_nlist() Function Returns Boolean False
« Reply #3 on: April 23, 2017, 06:26:17 AM »
I'm not familiar with this area, and so can't offer any more help than what I gave before. All I can suggest is opening a support ticket and working with them to try to figure out the magic incantation to get it working. You should first (if you haven't already) google ftp_nlist and see what things others have done to fix this problem (it seems to be reasonably common).

BTW, others have said they activated passive mode (via ftp_pasv), so I don't know if you're going in the wrong direction by going to non-passive mode. At least, you're sure you tried passive mode?

Best wishes.
Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-

Offline kiusau

  • Space Explorer
  • ***
  • Posts: 6
Re: PHP's ftp_nlist() Function Returns Boolean False
« Reply #4 on: April 24, 2017, 09:29:40 AM »
Quote
All I can suggest is opening a support ticket and working with them to try to figure out the magic incantation to get it working.

According to Lunarpages Customer Service the problem that I am having is code specific, not a connection problem, and therefore not worthy of their attention.

If you have any more suggestions, please advise.

Roddy

 

Share |