NO BUG: Error 500 when importing settings

Browser: Firefox 123
OS: macOS
URL: dev site (localhost)
PHP version : 8.3.3
WordPress version : 6.4.3


when I import settings from a json settings file generated with bricks by another local website, I’ve an error HTTP 500 with this log error :

PHP Fatal error: Uncaught TypeError: ftp_fget(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /www/www-fondation/wp-admin/includes/class-wp-filesystem-ftpext.php:146
Stack trace:
#0 /www/www-fondation/wp-admin/includes/class-wp-filesystem-ftpext.php(146): ftp_fget(NULL, Resource id #10, ‘/private/var/tm…’, 2)
#1 /www/www-fondation/wp-content/themes/bricks/includes/admin.php(440): WP_Filesystem_FTPext->get_contents(‘/private/var/tm…’)
#2 /www/www-fondation/wp-includes/class-wp-hook.php(324): Bricks\Admin->import_global_settings(‘’)
#3 /www/www-fondation/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(‘’, Array)
#4 /www/www-fondation/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#5 /www/www-fondation/wp-admin/admin-ajax.php(188): do_action(‘wp_ajax_bricks_…’)
#6 {main}
thrown in /www/www-fondation/wp-admin/includes/class-wp-filesystem-ftpext.php on line 146, referer: http://localhost/www-fondation/wp-admin/admin.php?page=bricks-settings

Hi Oli,
Welcome to the forum, and thanks so much for your report!

A plugin conflict or the file system may cause the problem. Have you already tried deactivating all your plugins? If the problem persists, try this:

Best regards,

It’s not a plugin conflict.
if ( ! defined( ‘FS_METHOD’ ) )
define( ‘FS_METHOD’, ‘direct’ );
added to wp-config.php, it’s OK.

Thanks a lot.

1 Like