• Resolved jhayghost13

    (@jhayghost13)


    Hello,

    I hope this message finds you well. I am experiencing an issue with the Ultimate Addons for Gutenberg plugin on my site, and I would appreciate your assistance in resolving it. The error log suggests a problem related to FTP connection handling within the plugin.

    Here are the relevant details from the error log:

    HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm.sock:", host: "[IP]"
    2024/12/06 12:58:40 [error] 16275#16275: *1241 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: ftp_fput(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /wp-admin/includes/class-wp-filesystem-ftpext.php:212
    Stack trace:
    #0 /wp-admin/includes/class-wp-filesystem-ftpext.php(212): ftp_fput()
    #1 /wp-content/plugins/ultimate-addons-for-gutenberg/lib/gutenberg-templates/inc/classes/ast-block-templates-notices.php(36): WP_Filesystem_FTPext->put_contents()
    #2 /wp-content/plugins/ultimate-addons-for-gutenberg/lib/gutenberg-templates/ast-block-plugin-loader.php(106): Gutenberg_Templates\Inc\Classes\Ast_Block_Templates_Notices->has_file_read_write()
    #3 /wp-includes/class-wp-hook.php(324): Gutenberg_Templates\Ast_Block_Plugin_Loader->load_classes()

    Additionally, please note that the filesystem is restricted for write from the web server. Here are some additional details about my environment that might be helpful:

    • WordPress Version: 6.7.1
    • PHP Version: 8.3
    • Web Server: Nginx

    I would appreciate any insights or updates you could provide to help rectify this problem. If there’s a patch or workaround available, please let me know.

    Thank you for your assistance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @jhayghost13,

    Thanks for getting in touch with us.

    You can fix the issue by adding the below code in wp-config.php

    define( ‘FS_METHOD’, ‘direct’ );

    Please try and let me know how it goes.

    Have a nice day!

    Thread Starter jhayghost13

    (@jhayghost13)

    Hello,

    Thanks for your response.

    May I know if this is intended to be a temporary setting for facilitating updates, and if it is safe to remove it afterward to address any potential security concerns?

    Additionally, could you please clarify which specific directories or files are being manipulated?

    I want to ensure that my WordPress installation remains secure, especially in a production environment, and would like to confirm the best practices for using this setting.

    Looking forward to your guidance.

    Thread Starter jhayghost13

    (@jhayghost13)

    After reviewing the situation, it appears that each time the page loads, there’s an attempt to write index.html to the uploads directory. For security reasons, we’ve disabled this action. I hope you can find an alternative approach, particularly if you’re not logged in.

    For now, I’ve temporarily commented out line 106 in lib/gutenberg-templates/ast-block-plugin-loader.php.

    Hi @jhayghost13,

    Yes, adding define('FS_METHOD', 'direct'); in the wp-config.php file is typically a temporary measure to allow direct file system access for updates and installation of plugins or themes. You can remove it once the issue is resolved, but it’s crucial to ensure that your server permissions are configured correctly to avoid needing this setting in the future.

    The FTP error and write attempts seem to be related to file uploads and plugin-generated templates. Specifically, it’s trying to write an index.html file into the uploads directory. You may want to check the directory permissions for wp-content/uploads to ensure that it’s writable by the web server, without compromising overall security.

      Please feel free to reach out if you need further clarification or assistance with this.

      Have a nice day! 😊

    Viewing 4 replies - 1 through 4 (of 4 total)

    The topic ‘Assistance Needed: FTP Connection Error’ is closed to new replies.