Skip to content
Blog cá nhân của PhongTV

Blog cá nhân của PhongTV

  • Home
  • About
  • Skills
  • Resume
  • Contact
  • Bài viết

How to fix error “Uncaught TypeError: ftp_fget(): Argument #1 ($ftp) must be of type FTP\Connection, null given in class-wp-filesystem-ftpext.php” in WordPress

pbk15 Tháng 5, 202415 Tháng 5, 2024 No Comments

If you get a critial error message when access your WordPress website, firstly enable the DEBUG mode. You can see detail error message like this:

Fatal error: Uncaught TypeError: ftp_fget(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /var/www/your-website.com/wp/wp-admin/includes/class-wp-filesystem-ftpext.php:146 Stack trace: #0 /var/www/YOUR-WEBSITE.COM/wp-admin/includes/class-wp-filesystem-ftpext.php(146): ftp_fget() #1 /var/www/YOUR-WEBSITE.COM/wp-content/themes/pixova-lite/inc/libraries/epsilon-framework/classes/class-epsilon-color-scheme.php(268): WP_Filesystem_FTPext->get_contents() #2 /var/www/YOUR-WEBSITE.COM/wp-content/themes/pixova-lite/functions.php(704): Epsilon_Color_Scheme::load_css_overrides() #3 /var/www/YOUR-WEBSITE.COM/wp-settings.php(663): include(‘…’) #4 /var/www/YOUR-WEBSITE.COM/wp-config.php(96): require_once(‘…’) #5 /var/www/YOUR-WEBSITE.COM/wp-load.php(50): require_once(‘…’) #6 /var/www/YOUR-WEBSITE.COM/wp-admin/admin.php(34): require_once(‘…’) #7 /var/www/YOUR-WEBSITE.COM/wp-admin/about.php(10): require_once(‘…’) #8 {main} thrown in /var/www/YOUR-WEBSITE.COM/wp-admin/includes/class-wp-filesystem-ftpext.php on line 146

The problem is not come from plugins, so do not need to disable all active plugins.

The reason is PHP 8 does not work with it. So you just need to install PHP 7 and change your web server setting to version 7 instead of version 8. For example, when I use nginx, just update this line:

fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; # it was php-8.1-fpm.sock before

Điều hướng bài viết

Previous: How to fix error “Duplicate key value violates unique constraint PK_xxx” when insert data into Postgres table
Next: How to get the SHA1 hash of a string in SQL Server

Để lại một bình luận Hủy

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Proudly powered by WordPress | Theme: Smart Portfolio by Code Work Web.
Contact Us

    This form is powered by: Sticky Floating Forms Lite