ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection
-
Hello
I have migrated a wp website to my digitalocean server and when I go to admin panel > header builder and trying to save it gives me an error:
PHP Fatal error: Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /var/www/mobshop/wp-admin/includes/class-wp-filesystem-ftpext.php:420
Stack trace:
#0 /var/www/mobshop/wp-admin/includes/class-wp-filesystem-ftpext.php(420): ftp_nlist()
#1 /var/www/mobshop/wp-admin/includes/class-wp-filesystem-ftpext.php(438): WP_Filesystem_FTPext->exists()
#2 /var/www/mobshop/wp-admin/includes/class-wp-filesystem-ftpext.php(392): WP_Filesystem_FTPext->is_file()
#3 /var/www/mobshop/wp-content/themes/xts-hitek/framework/includes/classes/class-styles-storage.php(277): WP_Filesystem_FTPext->delete()
#4 /var/www/mobshop/wp-content/themes/xts-hitek/framework/includes/classes/class-styles-storage.php(298): XTS\Styles_Storage->delete_file()
#5 /var/www/mobshop/wp-content/themes/xts-hitek/framework/includes/classes/class-styles-storage.php(251): XTS\Styles_Storage->write_file()
#6 /var/www/mobshop/wp-content/themes/xts-hitek/framework/modules/header-builder/class-header.php(233): XTS\Styles_Storage->write()
#7 /var/www/mobshop/wp-content/themes/xts-hitek/framework/modules/header-builder/class-header-factory.php(68): XTS\Header_Builder\Header->save()
#8 /var/www/mobshop/wp-content/themes/xts-hitek/framework/modules/header-builder/class-manager.php(79): XTS\Header_Builder\Header_Factory->update_header()
#9 /var/www/mobshop/wp-includes/class-wp-hook.php(308): XTS\Header_Builder\Manager->save_header()
#10 /var/www/mobshop/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#11 /var/www/mobshop/wp-includes/plugin.php(517): WP_Hook->do_action()
#12 /var/www/mobshop/wp-admin/admin-ajax.php(188): do_action()
#13 {main}
thrown in /var/www/mobshop/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420
it is solved by adding this code in wp-config file
if ( ! defined( 'FS_METHOD' ) ) define( 'FS_METHOD', 'direct' );
Glad that the issue is sorted out.
If there’s anything you need, please write me or another member of our help desk team.
We’re here for you!
Kind Regards
The topic ‘ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection’ is closed to new replies.