I've installed WP-CLI on the Mac and my next step is to execute WP-CLI commands using PHP script.
I've tried to implement it the following way but I do not see anything happening. Can someone please look at my code and tell me that what I'm doing wrong?
I'm using Docker and have WP installed in Docker/xamp/www/wordpress_wwws/htdocs
directory
Do I need to execute the PHP code from within the WP directory or can It be in any directory on the server?
define( 'WP_CLI_ROOT', '/usr/local/bin/wp' );
include WP_CLI_ROOT . '';
$output = shell_exec("wp --info");
echo "<pre>".$output."</pre>";
Do I need to configure and setup wp-cli with my PHP files?
Also, when I type wp --info on my terminal the following information comes up. Nothing is appearing beside the Package Dir & global config. do I also need to make adjustments to wp-cli?
MAC-00343:htdocs mike$ wp --info
PHP binary: /usr/bin/php
PHP version: 5.6.30
php.ini used:
WP-CLI root dir: phar://wp-cli.phar
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /Users/mike/Docker/xamp/www/wordpress_wwws/htdocs
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 1.3.0
Any help or suggestions will be much appreciated.
Thanks