• Resolved Deepak

    (@d88pak)


    Hi Team,

    I am simply trying to regerate thumbnails using WP CLI with this command on my WordPress site.

    wp media regenerate --yes

    This shows me the permission denied error.

    Unable to open /wp-content/wflogs/config-synced.php for reading and writing.

    I don’t understand. Why WP CLI has to do with Wordfence files.

    Can someone guide me on how to use WP CLI with Wordfence intact (installed and running) in my site?

    Thanks!

    • This topic was modified 1 year ago by Deepak.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support wfphil

    (@wfphil)

    Hi @d88pak

    If you have manually switched to using the MySQLi storage engine to store the firewall data then see our guide below for preventing PHP errors when using WP-CLI:

    https://www.wordfence.com/help/firewall/mysqli-storage-engine/#using-wp-cli-with-the-mysqli-storage-engine

    Thread Starter Deepak

    (@d88pak)

    Hi @wfphil,

    I don’t remember doing this and my wordfence-waf.php doesn’t show any mysqli related setting.

    <?php
    // Before removing this file, please verify the PHP ini setting
    auto_prepend_file does not point to this.

    if (file_exists(__DIR__.'/wp-content/plugins/wordfence/waf/bootstrap.php')) {
    define("WFWAF_LOG_PATH", __DIR__.'/wp-content/wflogs/');
    include_once __DIR__.'/wp-content/plugins/wordfence/waf/bootstrap.php';
    }

    I have added the suggested line from the link in my wp-config.php

    if( ! defined('WFWAF_STORAGE_ENGINE')) { define('WFWAF_STORAGE_ENGINE', 'mysqli'); }

    Howerver, I am getting this new error

    Permission denied in phar:///usr/local/bin/wp/vendor/wp-cli/media-command/src/Media_Command.php on line 687

    Do you have any suggestions? or can you point me to the right direction?

    Thanks!

    Plugin Support wfphil

    (@wfphil)

    Hi @d88pak

    Thank you for the update.

    Please remove the line below form your wp-config.php file:

    if( ! defined('WFWAF_STORAGE_ENGINE')) { define('WFWAF_STORAGE_ENGINE', 'mysqli'); }

    Try using our constant WFWAF_LOG_FILE_MODE and set permissions to 0660:

    define('WFWAF_LOG_FILE_MODE', 0660);

    https://www.wordfence.com/help/advanced/constants/#web-application-firewall-waf

    Thread Starter Deepak

    (@d88pak)

    Hi @wfphil ,

    Thanks for the update. I have done as you said. So far the previous message disappeared.

    It does regenerate some media files, but after few runs it shows this error message.

    PHP Warning: chmod(): Operation not permitted in /wp-includes/class-wp-image-editor-imagick.php on line 867

    Now I am not sure if this is related to Wordfence in particular or permission issue.

    Please suggest if you happen to know about this issue.

    Thanks!

    • This reply was modified 1 year ago by Deepak.
    Plugin Support wfphil

    (@wfphil)

    Hi @d88pak

    That shouldn’t be caused by our plugin and looks like it is a server user ownership issue and your hosting provider can help you to resolve it.

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

The topic ‘What does WP CLi has to do with wflogs?’ is closed to new replies.