Title: Fatal error when using wp-cli
Last modified: October 16, 2020

---

# Fatal error when using wp-cli

 *  Resolved [simonvw](https://wordpress.org/support/users/simonvw/)
 * (@simonvw)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-when-using-wp-cli/)
 * Hi,
 * With 2fas plugin installed a Fatal Error is thrown when using wp cli. The same
   error is thrown with every command.
 * `Fatal error: Uncaught Error: Class 'TwoFAS\TwoFAS\Http\Action_Index' not found
   in /<path-to-wordpress-install>/wp-content/plugins/2fas/routes.php:17`
 * Adding this in `twofas.php` solves the problem:
 *     ```
       if (php_sapi_name() === 'cli') {
       	return;
       }
       ```
   
 * Could this be fixed?

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

 *  [Mike van den Hoek](https://wordpress.org/support/users/mvdhoek1/)
 * (@mvdhoek1)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-when-using-wp-cli/#post-13556213)
 * I’ve encountered same problem, I hope the error will be fixed soon because of
   security reasons for our client.
 *  Plugin Author [2FAS](https://wordpress.org/support/users/2fas/)
 * (@2fas)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-when-using-wp-cli/#post-13579893)
 * We fixed this issue in 3.0.2 version of our plugin.
 *  Thread Starter [simonvw](https://wordpress.org/support/users/simonvw/)
 * (@simonvw)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-when-using-wp-cli/#post-13581771)
 * The issue is indeed fixed in 3.0.2. Thanks for solving this on a short notice!
 * For the future it would be very helpful if I could rollback to the previous version
   while waiting for a fix. This would prevent me from having to turn off 2fas on
   our client website altogether.
 * Is there a reason that only “dev-trunk” and the latest version are available 
   on wpackagist?

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

The topic ‘Fatal error when using wp-cli’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/2fas_ffffff.svg)
 * [2FAS Classic - Two Factor Authentication](https://wordpress.org/plugins/2fas/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/2fas/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/2fas/)
 * [Active Topics](https://wordpress.org/support/plugin/2fas/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/2fas/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/2fas/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [simonvw](https://wordpress.org/support/users/simonvw/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-when-using-wp-cli/#post-13581771)
 * Status: resolved