Cara Atasi Fatal Error ftp_nlist must be of type resource

Posted on

Fatal Error ftp_nlist 

Cara Atasi Fatal Error ftp_nlist must be of type resource – Ini adalah pengalaman saya ketika memindahkan data wordpress dari live ke localhost. beberapa plugin mengalami error dan salah satunya adalah pada plugin Elementor.

Ketika saya merubah data seting plugin dan menyimpannya, maka muncul error seperti :

Fatal error: Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type resource, null given in /opt/lampp/htdocs/alazhar/wp-admin/includes/class-wp-filesystem-ftpext.php:420 Stack trace: #0 /opt/lampp/htdocs/alazhar/wp-admin/includes/class-wp-filesystem-ftpext.php(420): ftp_nlist(NULL, '/opt/lampp/htdo...') #1 /opt/lampp/htdocs/alazhar/wp-admin/includes/class-wp-filesystem-ftpext.php(438): WP_Filesystem_FTPext->exists('/opt/lampp/htdo...') #2 /opt/lampp/htdocs/alazhar/wp-admin/includes/class-wp-filesystem-ftpext.php(710): WP_Filesystem_FTPext->is_file('/opt/lampp/htdo...') #3 /opt/lampp/htdocs/alazhar/wp-admin/includes/file.php(1828): WP_Filesystem_FTPext->dirlist('/opt/lampp/htdo...') #4 /opt/lampp/htdocs/alazhar/wp-content/plugins/elementor/modules/safe-mode/module.php(97): copy_dir('/opt/lampp/htdo...', '/opt/lampp/htdo...') #5 /opt/lampp/htdocs/alazhar/wp-content/plugins/elementor/modules/safe-mode/module.php(58): ElementorModulesSafeModeModule->enable_safe_mode() #6 /opt/lampp/htdocs/alazhar/wp-includes/class-wp-hook.php(305): ElementorModulesSafeModeModule->on_update_safe_mode('global', false) #7 /opt/lampp/htdocs/alazhar/wp-includes/plugin.php(189): WP_Hook->apply_filters('global', Array) #8 /opt/lampp/htdocs/alazhar/wp-includes/option.php(430): apply_filters('pre_update_opti...', 'global', false, 'elementor_safe_...') #9 /opt/lampp/htdocs/alazhar/wp-admin/options.php(314): update_option('elementor_safe_...', 'global') #10 {main} thrown in /opt/lampp/htdocs/alazhar/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420

Cara Memperbaiki Fatal Error ftp_nlist must be of type resource

Untuk memperbaiki adalah dengan cara:
  • Buka file “wp-config.php”
  • Kemudian tambahkan perintah:
  • if (!defined('FS_METHOD')) define('FS_METHOD', 'direct');
  • Seperti pada gambar :
    Fatal Error ftp_nlist must be of type resource
  • Setelah itu, simpan filenya.
  • Reload kembali halaman yang bermasalah.
  • Selesai
Semoga bermanfaat bagi semua. Terima kasih.

Leave a Reply

Your email address will not be published.