最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp cli - wp-cli commands do nothing, return nothing

programmeradmin0浏览0评论

I'm using wp-cli 1.5.1. My server is running php7.2.

I'm not running suhosin. (Some people seem to think that suhosin may cause the same symptom)

When I issue wpcli commands within a non-wordpress directory I get the expected outcome: and error message saying "This does not seem to be a WordPress install."

However, when I run wpcli commands within wordpress directories,the prompt returns quickly without output.

This seems to apply to most variations of 'wpcli plugin', 'wpcli theme', 'wpci search-replace' and 'wp theme'. These are the ones that I've tested.

'wp --version' and 'wp --help' return the expected output'.

What could be happening here?

I'm using wp-cli 1.5.1. My server is running php7.2.

I'm not running suhosin. (Some people seem to think that suhosin may cause the same symptom)

When I issue wpcli commands within a non-wordpress directory I get the expected outcome: and error message saying "This does not seem to be a WordPress install."

However, when I run wpcli commands within wordpress directories,the prompt returns quickly without output.

This seems to apply to most variations of 'wpcli plugin', 'wpcli theme', 'wpci search-replace' and 'wp theme'. These are the ones that I've tested.

'wp --version' and 'wp --help' return the expected output'.

What could be happening here?

Share Improve this question asked May 23, 2018 at 1:36 bobbob 2491 gold badge6 silver badges16 bronze badges 1
  • Are you connected via SSH? Are you connected as user or root? What are the permitions of this specific directory (WordPress installation)? – fat_mike Commented Sep 9, 2018 at 16:22
Add a comment  | 

2 Answers 2

Reset to default 8

Try the --skip-plugins flag with the problematic commands. Just as you experienced I’ve had wp-cli error out silently and do nothing, while frustratingly work for the simpler commands version/info commands.

My silent errors were due to a bad plugin. This plugin was using php short tags, which weren't enabled in php/x.x/cli/php.ini which wp-cli uses.

I had a similar issue and here is what I have found:

  • html_errors set Off would result in no output from wp-cli (when there were PHP errors such as PHP Notice: Trying to access array offset on value of type null)

  • apparently, this issue is known and there is a workaround already - https://github/wp-cli/wp-cli/issues/5422

    • in short, PHP 7.x produces lots of warnings; switching to nightly build allows to solve it: wp cli update --nightly
发布评论

评论列表(0)

  1. 暂无评论