• I am getting the error (“Warning: ftp_nlist() expects parameter 1 to be resource”) — after clicking “Pages | Add New”, the browser clears and the error displays briefly and then disappears as the normal New Page editor displays.

    If I deactivate Kadence Blocks, the error stops.

    I get this message even using the Twenty Twenty-One theme and with no other plugins.

    All 2.x (tested through 2.0.7) versions exhibit this behavior. Version 1.10.9 does not.

    What do I do to fix? Thanks.

Viewing 5 replies - 16 through 20 (of 20 total)
  • I just found out that my solution above prevents me from updating WordPress, as it now tries to install updates without asking for my FTP credentials, which won’t work for my hosting setup.

    So, I added the line if ( ! defined( 'FS_METHOD' ) ) define( 'FS_METHOD', 'direct' ); to kadence-blocks.php and it seems to solve the issue with the Design Library, without affecting other parts of the admin.

    @britner could you please consider officially adding this to the plugin? This page provides a description of the available WP filesystem methods, and I believe the Design Library will only work with direct filesystem access, but other users may have a different configuration for WP updates.

    @hvianna
    Thanks for posting, no I can’t add definitions for FS_METHOD that is not something a plugin should do and I’m sure it’s against guidelines.

    If your hosting setup requires that you manually add ftp information to update or upload then most likely I need to add something to disable the design library in that case. Can you tell me how you have things setup in your config for this?

    Ben

    @britner Thank you for your prompt response!

    The system user which runs PHP in my installation doesn’t have write access to the WP directory, except for some folders inside it, like uploads and cache. I suppose WP detects that and automatically sets the filesystem method to FTP, because I don’t have any particular setting for that in my wp-config.

    I guess the problem is that the methods from WP_Filesystem classes always try to use whatever filesystem method is currently active, so in my case it wants to use FTP for everything.

    I know that seems to be a pretty restricted/obscure issue, but I wonder if you could use alternate functions to write the design library files, because I would really love to keep it working.

    Thanks again!

    Henrique

    Hey,
    Using a system outside of the core WP_Filesystem seems like that would be “not the WordPress way”. I don’t think I’ll be heading down that path if I can help it ??

    Perhaps a different solution would be to place the JSON cache in the uploads directory instead of the content directory. It sounds like that would solve things for you?

    Ben

    I’m not sure, but I see I have other plugins that created a directory inside the uploads folder, so it may work!

    Another idea, if it’s just a JSON file you need to store, maybe you could use a WP transient instead?

    Sorry for the crappy ideas ?? and thanks again for you willingness to help!

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Warning: ftp_nlist() expects parameter 1 to be resource’ is closed to new replies.