Fatal error: Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given

What issue or error are you experiencing?

  • I pulled my staging site from WP Engine
  • Tried to log using a user I created just for developing with Local
  • Entered user and password
  • Got the error:
    Fatal error : Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given in D:\Softwares\Local\sites****\app\public\wp-admin\includes\class-wp-filesystem-ftpext.php:438

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

System Details

  • Local Version: Version 8.2.1+6583

  • Operating System (OS) and OS version: Windows 11 Pro V23H2

Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @tpolati

That error seems to indicate that you’re using the ftp_nlist() function in PHP, but you’re passing a null value instead of an object of type FTP\Connection as the first argument.

If you’re not having any errors like this pop up on the live site I wonder if it could be an issue of configuration. Are you using the same version of PHP? Do your files have permissions granted? Are there any FTP connection or server settings that need to be adjusted?

Hey @Nick-B thanks for replying.

The live site, and all it’s environments (dev and staging) are working fine. I get this error and I try to log into the local site.
I clone it connection Local to WP Engine, thus I believe the PHP version, webserver, etc are all the same for it didn’t give me an option to change them.

No ideia why an FTP error is happening.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.