title: Execute WP CLI commands in PHP script
body: <p>To do this, I copied the repository WP CLI into Root WordPress</p>
  
  <p>And I wrote the following PHP code to encode it and encountered the following errors</p>
  
  <pre class="lang-php prettyprint-override"><code>define('WP_CLI_ROOT', ABSPATH . 'wp-cli');
  require_once WP_CLI_ROOT . '/php/wp-cli.php';
  </code></pre>
  
  <pre class="lang-php prettyprint-override"><code>Warning: include_once(D:\Web\Sites\jupiterx/wp-cli/vendor/rmccue/requests/library/Requests.php): failed to open stream: No such file or directory in D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Bootstrap\IncludeFrameworkAutoloader.php on line 48
  
  Warning: include_once(): Failed opening 'D:\Web\Sites\jupiterx/wp-cli/vendor/rmccue/requests/library/Requests.php' for inclusion (include_path='C:\xampp\php\PEAR') in D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Bootstrap\IncludeFrameworkAutoloader.php on line 48
  
  Warning: include_once(D:\Web\Sites\jupiterx/wp-cli/vendor/wp-cli/mustangostang-spyc/Spyc.php): failed to open stream: No such file or directory in D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Bootstrap\IncludeFrameworkAutoloader.php on line 49
  
  Warning: include_once(): Failed opening 'D:\Web\Sites\jupiterx/wp-cli/vendor/wp-cli/mustangostang-spyc/Spyc.php' for inclusion (include_path='C:\xampp\php\PEAR') in D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Bootstrap\IncludeFrameworkAutoloader.php on line 49
  
  Warning: array_slice() expects parameter 1 to be array, null given in D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Runner.php on line 905
  
  Warning: Invalid argument supplied for foreach() in D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Configurator.php on line 138
  
  Warning: implode(): Invalid arguments passed in D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Runner.php on line 1024
  
  Fatal error: Uncaught Error: Class 'cli\Colors' not found in D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Loggers\Regular.php:70 Stack trace: #0 D:\Web\Sites\jupiterx\wp-cli\php\class-wp-cli.php(881): WP_CLI\Loggers\Regular-&gt;error_multi_line(Array) #1 D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Runner.php(248): WP_CLI::error_multi_line(Array) #2 D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Runner.php(1083): WP_CLI\Runner::set_wp_root('D:\\Web\\Sites\\ju...') #3 D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Bootstrap\LaunchRunner.php(23): WP_CLI\Runner-&gt;start() #4 D:\Web\Sites\jupiterx\wp-cli\php\bootstrap.php(74): WP_CLI\Bootstrap\LaunchRunner-&gt;process(Object(WP_CLI\Bootstrap\BootstrapState)) #5 D:\Web\Sites\jupiterx\wp-cli\php\wp-cli.php(27): WP_CLI\bootstrap() #6 D:\Web\Sites\jupiterx\wp-content\plugins\tabanShahrSiteSaz\Plugin.php(72): require_once('D:\\Web\\Sites\\ju...') #7 D:\Web\Sites\jupiterx\wp-content\plugins\tabanShahrSiteSaz\app\core\SingletonPattern.php(26): TabanShahrSiteSaz\Plugin-&gt;includes() #8 D:\Web\Sites\jupiterx\wp-conten in D:\Web\Sites\jupiterx\wp-cli\php\WP_CLI\Loggers\Regular.php on line 70
  </code></pre>
  
  <p>Thanks in advance for your help</p>