wp-cli / import-command

Imports content from a given WXR file.
MIT License
20 stars 24 forks source link

wp import problem #37

Closed binooetomo closed 6 years ago

binooetomo commented 6 years ago

Dear All.

I try to import demo data of 'gaze' theme.

Here is my result

[gazebasicint@sarkem public_html]$ wp import ./wp-content/themes/gaze/admin/demo-data/content.xml --authors=create
Starting the import process...
Fatal error: Uncaught Error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strlen() in phar:///usr/local/bin/wp/vendor/symfony/polyfill-mbstring/Mbstring.php:476
Stack trace:
#0 phar:///usr/local/bin/wp/vendor/symfony/polyfill-mbstring/bootstrap.php(33): Symfony\Polyfill\Mbstring\Mbstring::mb_strlen('wpengine', 'UTF-8')
#1 /home/gazebasicint/public_html/wp-includes/user.php(1481): mb_strlen('wpengine')
#2 phar:///usr/local/bin/wp/vendor/wp-cli/import-command/src/Import_Command.php(365): wp_insert_user(Array)
#3 phar:///usr/local/bin/wp/vendor/wp-cli/import-command/src/Import_Command.php(283): Import_Command->create_authors_for_mapping(Array)
#4 phar:///usr/local/bin/wp/vendor/wp-cli/import-command/src/Import_Command.php(128): Import_Command->process_author_mapping('create', Array)
#5 phar:///usr/local/bin/wp/vendor/wp-cli/import-command/src/Import_Command.php(78): Import_Command->import_wxr('./wp-content/th...', Array)
#6 [internal function]: Import_Command->__invoke(Array, Array)
#7 phar:///usr/local/bin/wp/ in phar:///usr/local/bin/wp/vendor/symfony/polyfill-mbstring/Mbstring.php on line 476

and here is my wp-cli version info


[gazebasicint@sarkem public_html]$ wp --info
OS: Linux sarkem.jcamp.net 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64
Shell:  /bin/bash
PHP binary: /opt/cpanel/ea-php56/root/usr/bin/php
PHP version:    5.6.38
php.ini used:   /opt/cpanel/ea-php56/root/etc/php.ini
WP-CLI root dir:    phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:  phar://wp-cli.phar/vendor
WP_CLI phar path:   /home/gazebasicint/public_html
WP-CLI packages dir:    
WP-CLI global config:   
WP-CLI project config:  
WP-CLI version: 2.0.1
schlessera commented 6 years ago

@binooetomo Your PHP interpreter was compiled without iconv support (which is normally provided by default: http://php.net/manual/en/iconv.installation.php

There's two possible ways of fixing this:

  1. Change your PHP interpreter (or install an extension) so that iconv support is enabled. The following command let's you verify support:

    $ php -i | grep "iconv support"
    iconv support => enabled
  2. If you're using Composer, add the symfony/polyfill-iconv package to your project:

    composer require symfony/polyfill-iconv

Note that GitHub issues are meant for enhancement requests and specific, reproducible bugs, not for general support questions. For support options, please review http://wp-cli.org/#support

If you have further questions, the easiest way to get support is to join us in the #cli channel on the Make WordPress Slack Team.