Title: Errors when installing using WP-CLI
Last modified: May 14, 2020

---

# Errors when installing using WP-CLI

 *  [d1g1tal](https://wordpress.org/support/users/d1g1tal/)
 * (@d1g1tal)
 * [6 years ago](https://wordpress.org/support/topic/errors-when-installing-using-wp-cli/)
 * Hi,
 * Getting these errors when installing Wordfence using wp CLI.
    Wordpress was a
   clean install.
 * Are these normal for Wordfence and plugin still works 100%?
    What can be done
   to get a clean install without errors?
 *     ```
       vhost:localhost:~/domains/mysite.com/htdocs> wp plugin install wordfence --activate
       Installing Wordfence Security – Firewall & Malware Scan (7.4.7)
       Laadin paigalduspaketti aadressilt https://downloads.wordpress.org/plugin/wordfence.7.4.7.zip...
       Pakin lahti...
       Paigaldan pluginat...
       Plugin edukalt paigaldatud.
       Activating 'wordfence'...
       Warning: fopen(/data01/vhost/domains/mysite.com/htdocs/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /data01/vhost/domains/mysite.com/htdocs/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 325
       Warning: flock() expects parameter 1 to be resource, bool given in /data01/vhost/domains/mysite.com/htdocs/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 326
       Warning: include(/data01/vhost/domains/mysite.com/htdocs/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /data01/vhost/domains/mysite.com/htdocs/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 32                             8
       Warning: include(/data01/vhost/domains/mysite.com/htdocs/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /data01/vhost/domains/mysite.com/htdocs/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 32                             8
       Warning: include(): Failed opening '/data01/vhost/domains/mysite.com/htdocs/wp-content/wflogs/rules.php' for inclusion (include_path='.:') in /data01/vhost/domains/mysite.com/htdocs/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line                              328
       Warning: flock() expects parameter 1 to be resource, bool given in /data01/vhost/domains/mysite.com/htdocs/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 329
       Warning: fclose() expects parameter 1 to be resource, bool given in /data01/vhost/domains/mysite.com/htdocs/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 330
       Plugin 'wordfence' activated.
       Success: Installed 1 of 1 plugins.
       ```
   

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

 *  [wfdave](https://wordpress.org/support/users/wfdave/)
 * (@wfdave)
 * [6 years ago](https://wordpress.org/support/topic/errors-when-installing-using-wp-cli/#post-12833719)
 * Hi [@d1g1tal](https://wordpress.org/support/users/d1g1tal/),
 * It looks like Wordfence can’t write to `wp-content/wflogs/*`.
 * There’s a few things you can try:
 * 1. Manually create the `wp-content/wflogs/*` folder, and make sure Wordfence 
   can read/write inside that folder
 * 2. Tell Wordfence to store the contents of `wflogs/*` in the database instead
 * You can do this by editing `wordfence-waf.php` and adding `define('WFWAF_STORAGE_ENGINE','
   mysqli');` right after `<?php` on a new line.
 * [https://www.wordfence.com/help/firewall/mysqli-storage-engine/](https://www.wordfence.com/help/firewall/mysqli-storage-engine/)
 * The above link describes in more detail on how to do this.
 * —
 * What this means is that upon installation you will always receive these errors
   if your host is preventing read/write to `wp-content/wflogs/*`, but after the
   changes in 2), your Wordfence installation should function normally.
 * Dave
 *  Thread Starter [d1g1tal](https://wordpress.org/support/users/d1g1tal/)
 * (@d1g1tal)
 * [6 years ago](https://wordpress.org/support/topic/errors-when-installing-using-wp-cli/#post-12838399)
 * Hi,
 * I even tried that I manually create wp-content/wflogs/ folder (chmod 777) before
   installing wordfence, but still getting same errors.
    Running wp plugin install“
   wordfence” is always without errors, but when I activate it: wp plugin activate“
   wordfence” It gives the same errors not matter what I do.
 * But after activation, wp-content/wflogs/ folder is there, it was created and 
   filled with files.
 *  [Jason Allen](https://wordpress.org/support/users/jasonabmw/)
 * (@jasonabmw)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/errors-when-installing-using-wp-cli/#post-13270006)
 * After installing Wordfence, it’s giving the following errors on EVERY command
   from the WordPress CLI, but the WAF isn’t even enabled.
 *     ```
       Warning: fopen(/home/user/public_html/test/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /home/user/public_html/test/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 325
       Warning: flock() expects parameter 1 to be resource, bool given in /home/user/public_html/test/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 326
       Warning: include(/home/user/public_html/test/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /home/user/public_html/test/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 328
       Warning: include(): Failed opening '/home/user/public_html/test/wp-content/wflogs/rules.php' for inclusion (include_path='.:/opt/alt/php73/usr/share/pear')in /home/user/public_html/test/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 328
       Warning: flock() expects parameter 1 to be resource, bool given in /home/user/public_html/test/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 329
       Warning: fclose() expects parameter 1 to be resource, bool given in /home/user/public_html/test/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 330
       ```
   
    -  This reply was modified 5 years, 9 months ago by [Jason Allen](https://wordpress.org/support/users/jasonabmw/).
    -  This reply was modified 5 years, 9 months ago by [Jason Allen](https://wordpress.org/support/users/jasonabmw/).

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

The topic ‘Errors when installing 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

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

 * 3 replies
 * 3 participants
 * Last reply from: [Jason Allen](https://wordpress.org/support/users/jasonabmw/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/errors-when-installing-using-wp-cli/#post-13270006)
 * Status: not resolved