Title: Fatal error when installing via WP CLI
Last modified: September 20, 2023

---

# Fatal error when installing via WP CLI

 *  Resolved [deanhibbert](https://wordpress.org/support/users/deanhibbert/)
 * (@deanhibbert)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-when-installing-via-wp-cli/)
 * Hi! We’ve been using disable-gutenberg for several years now. It’s worked great
   for us! But we’ve run into a snag that’s causing our automated deploy processes
   some trouble…
 * We use WP CLI to install our plugins for our self-hosted WP instances, but ever
   since disable-gutenberg 3.0+, the plugin throws a fatal error whenever we try
   to activate it via the command line:
 *     ```wp-block-code
       PHP Fatal error:  Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "disable_gutenberg_dismiss_notice_activate" not found or invalid function name in /.../wp-includes/class-wp-hook.php:310
       ```
   
 * I believe this is because the file defining the function `disable_gutenberg_dismiss_notice_activate`(
   in `inc/settings-reset.php`) is being required only if `is_admin()` is true. 
   This explains how we’re able to activate the plugin on the WP backend, but not
   via the CLI!
 * We’re able to replicate this on a fresh WP install with no other plugins and 
   the default themes:
   1. `wp plugin install disable-gutenberg` will successfully
   install the plugin.2. `wp plugin activate disable-gutenberg` will cause the fatal
   error.3. Activating the plugin in the backend works without any problems!
 * I was able to successfully activate the plugin with WP CLI when I moved `disable-
   gutenberg.php:100` out of the `is_admin()` check.
 * Thanks!

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

 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-when-installing-via-wp-cli/#post-17066701)
 * Thanks for reporting, will investigate and try to get fixed up for the next plugin
   update.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-when-installing-via-wp-cli/#post-17139756)
 * Just to follow up with this, the issue is resolved in the next version (3.1) 
   of DG. Thank you for the detailed report and solution, [@deanhibbert](https://wordpress.org/support/users/deanhibbert/).
 *  Thread Starter [deanhibbert](https://wordpress.org/support/users/deanhibbert/)
 * (@deanhibbert)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-when-installing-via-wp-cli/#post-17161482)
 * [@specialk](https://wordpress.org/support/users/specialk/) Thank you very much–
   that’s great!

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

The topic ‘Fatal error when installing via WP CLI’ is closed to new replies.

 * ![](https://ps.w.org/disable-gutenberg/assets/icon-256x256.png?rev=1925990)
 * [Disable Gutenberg](https://wordpress.org/plugins/disable-gutenberg/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/disable-gutenberg/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/disable-gutenberg/)
 * [Active Topics](https://wordpress.org/support/plugin/disable-gutenberg/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disable-gutenberg/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disable-gutenberg/reviews/)

## Tags

 * [3.0](https://wordpress.org/support/topic-tag/3-0/)
 * [cli](https://wordpress.org/support/topic-tag/cli/)
 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [Install](https://wordpress.org/support/topic-tag/install/)
 * [wp-cli](https://wordpress.org/support/topic-tag/wp-cli/)

 * 3 replies
 * 2 participants
 * Last reply from: [deanhibbert](https://wordpress.org/support/users/deanhibbert/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-when-installing-via-wp-cli/#post-17161482)
 * Status: resolved