4

I am trying to make a copy of a live site on a test server. I installed wp-cli and wp-cli sometimes works and sometimes doesn't. When it doesn't work, it just returns nothing. Not one character of output. I can view the website, apache, php and mysql all seem to be working. I turned on WP_DEBUG in wp-config.php and I see a couple of minor errors, as follows:

PHP Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /var/www/wp-includes/functions.php on line 3083 Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /var/www/wp-includes/functions.php on line 3083

I have tried wp-cli --debug

The only command that works is wp-cli --info

This is the output of wp-cli, in case that is helpful.

PHP binary: /usr/bin/php5‌‌
PHP version: 5.5.3-1ubuntu2.3
php.ini used: /etc/php5/cli/php.ini
WP-CLI root dir: phar://wp-cli.phar
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 0.15.0

Every once in a while, a command will work. This is very strange.

3
  • I forgot to mention that I am using Wordpress multi-site.
    – jeff
    Apr 21, 2014 at 3:26
  • 1
    This method isn't used by WP core or wp-cli either. It must be coming from somewhere else.
    – Rarst
    Apr 21, 2014 at 17:45
  • I also have this problem - wp --info and wp --debug get me something, but all other commands are failing silently. Not using a multisite.
    – piersb
    Sep 23, 2016 at 9:28

4 Answers 4

2

You need to use the --url flag when you have a multisite.

wp-cli --debug --url=www.example.com

or

wp theme list --url=www.example.com
1
0

If you only installed php5-cli then you probably don't have php5-mysql. Try running sudo apt-get install php5-mysql and see if that helps.

0

I had this problem on a single-site install. Turned out that I had a broken plugin, and that was causing the site itself to fail with a fatal error.

Once I replaced the broken plugin and the fatal error went away, wp-cli worked as normal.

0

It can happen when you have malware in your installation.

Check the wp-config.php file for signs of malware.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.