Title: Error when using WP-CLI
Last modified: May 12, 2023

---

# Error when using WP-CLI

 *  Resolved [gmariani405](https://wordpress.org/support/users/gmariani405/)
 * (@gmariani405)
 * [3 years ago](https://wordpress.org/support/topic/error-when-using-wp-cli-6/)
 * Trying to install Wordfence using WP-CLI and running into errors since it doesn’t
   seem to initialize properly without the GUI. Could it be patched to at-least 
   not error out like this?
 *     ```wp-block-code
       PHP Warning:  fopen(/chroot/home/USER/DOMAIN/html/wp-content/wflogs/rules.php): Failed to open stream: No such file or directory in /chroot/home/USER/DOMAIN/html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 332
       Warning: fopen(/chroot/home/USER/DOMAIN/html/wp-content/wflogs/rules.php): Failed to open stream: No such file or directory in /chroot/home/USER/DOMAIN/html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 332
       PHP Warning:  include(/chroot/home/USER/DOMAIN/html/wp-content/wflogs/rules.php): Failed to open stream: No such file or directory in /chroot/home/USER/DOMAIN/html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 335
       Warning: include(/chroot/home/USER/DOMAIN/html/wp-content/wflogs/rules.php): Failed to open stream: No such file or directory in /chroot/home/USER/DOMAIN/html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 335
       PHP Warning:  include(): Failed opening '/chroot/home/USER/DOMAIN/html/wp-content/wflogs/rules.php' for inclusion (include_path='.:/opt/remi/php80/root/usr/share/pear:/opt/remi/php80/root/usr/share/php:/usr/share/pear:/usr/share/php') in /chroot/home/USER/DOMAIN/html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 335
       Warning: include(): Failed opening '/chroot/home/USER/DOMAIN/html/wp-content/wflogs/rules.php' for inclusion (include_path='.:/opt/remi/php80/root/usr/share/pear:/opt/remi/php80/root/usr/share/php:/usr/share/pear:/usr/share/php') in /chroot/home/USER/DOMAIN/html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 335
       ```
   

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

 *  Plugin Support [wfjanet](https://wordpress.org/support/users/wfjanet/)
 * (@wfjanet)
 * [3 years ago](https://wordpress.org/support/topic/error-when-using-wp-cli-6/#post-16742369)
 * Hi @gmariani405,
 * Thank you for reaching out.
 * I have seen issues similar to yours with customers that host on WPEngine since
   they don’t allow the use of the file based storage engine for the firewall configuration
   data. 
 * To resolve this**, **you would need to switch **MySQLi** storage engine so that
   sites can store firewall data in the MySQL database instead of using files in“**
   wp-content/wflogs/**“.
 * You can find the instructions on the link below:
 * [https://www.wordfence.com/help/firewall/mysqli-storage-engine/](https://www.wordfence.com/help/firewall/mysqli-storage-engine/)
 * Let me know how it goes.
 * Thanks,
 * Janet.
 *  [Goto Hayato](https://wordpress.org/support/users/gh640/)
 * (@gh640)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/error-when-using-wp-cli-6/#post-16871501)
 * I bumped into this issue.
 * > To resolve this, you would need to switch MySQLi storage engine so that sites
   > can store firewall data in the MySQL database instead of using files in “wp-
   > content/wflogs/“.
 * Unfortunately this is not applicable in this case as the file `wordfence-waf.
   php` where one should declare the constant `WFWAF_STORAGE_ENGINE` to switch to
   the MySQLi storage doesn’t exist yet.
 * It might be possible to work around the warning using `wp-config.php`, but there
   should be a way to activate the plugin with WP-CLI without any issue…

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

The topic ‘Error when using WP-CLI’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [wp-cli](https://wordpress.org/support/topic-tag/wp-cli/)

 * 2 replies
 * 3 participants
 * Last reply from: [Goto Hayato](https://wordpress.org/support/users/gh640/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/error-when-using-wp-cli-6/#post-16871501)
 * Status: resolved