WP-CLI Outputs wp-config.php

Any ideas when I get the wp-config.php outputted when I use WP-CLI?

I had seen similar outputs on the website prior to enabling PHP shorttags. I doubt it’s connected, but thought worth mentioning.

Here is a screenshot: https://www.dropbox.com/s/ab9joka23lvm9ik/Screenshot%202018-02-05%2017.02.19.png?dl=0

It outputs after running a WPCLI command. The command is still executed after the output.

I also see this outputted at the end:

0.1176 3070672 9. define() phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(1070) : eval()'d code:112

I get this at the beginning:

Warning: PHP Startup: Unable to load dynamic library ‘/opt/php/7.1.4/lib/php/extensions/no-debug-non-zts-20160303/php_openssl.dll’ - /opt/php/7.1.4/lib/php/extensions/no-debug-non-zts-20160303/php_openssl.dll: cannot open shared object file: No such file or directory in Unknown on line 0

Notice: Undefined index: SERVER_NAME in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(1070) : eval()'d code on line 25

Call Stack:
0.0001 344952 1. {main}() /usr/local/bin/wp:0
0.0099 747192 2. include(‘phar:///usr/local/bin/wp/php/boot-phar.php’) /usr/local/bin/wp:4
0.0100 748384 3. include(‘phar:///usr/local/bin/wp/php/wp-cli.php’) phar:///usr/local/bin/wp/php/boot-phar.php:8
0.0102 750496 4. WP_CLI\bootstrap() phar:///usr/local/bin/wp/php/wp-cli.php:23
0.0940 2977136 5. WP_CLI\Bootstrap\LaunchRunner->process() phar:///usr/local/bin/wp/php/bootstrap.php:75
0.0940 2977176 6. WP_CLI\Runner->start() phar:///usr/local/bin/wp/php/WP_CLI/Bootstrap/LaunchRunner.php:23
0.0970 3033208 7. WP_CLI\Runner->load_wordpress() phar:///usr/local/bin/wp/php/WP_CLI/Runner.php:1032
0.0979 3069432 8. eval(’/**

Advice appreciated.


I think this is because we are using shorttags in our code.

Eg. <? and not <?php

Although we have this set in the php for the site, perhaps the php that runs wp-cli is breaking with this. The question: how do we allow shorttags on the server to use wp-cli.