背景
最近、Wordpressの制作依頼が多い。
Wordpressは開発だけではなく、コンテンツもセットで納品する前提なのが辛いですが、大量のコンテンツ入稿に役立つcsv入力・出力ができると、大量のコンテンツの操作が楽になります。
昔は、Really Simple CSV Importer にお世話になってましたが、最近は、メンテされていないため、使えなそう。。。
そこで、探したらありました。
WP All Import
WordPress XML Import. WordPress CSV Import. Easy.
WP All Export
Export anything in WordPress to CSV, XML, or Excel.
問題
WP All Export の方は、有効にしたところ、私の環境では、下記のエラーが発生してました。
■ Error 1
PHPのZipArchiveクラスが見当たりません
ZipArchive class is missing on your server.
Please contact your web hosting provider and ask them to install and activate ZipArchive.
■ Error 2
XML系のパッケージがないです
Required PHP components are missing.
WP All Export requires XMLReader, and XMLWriter PHP modules to be installed.
These are standard features of PHP, and are necessary for WP All Export to write the files you are trying to export.
Please contact your web hosting provider and ask them to install and activate the DOMDocument, XMLReader, and XMLWriter PHP modules.
対応...の前に前提
私の環境
AWS - EC2(Amazon linux)
PHP - PHP 7.2.x
WebS - Apache 2.4.x
対応
■ Error 1
$ sudo yum remove libzip
$ sudo yum --enablerepo=remi install php72-php-zip
- Amazon core パッケージに入っているlibzipがコンフリクトするため、最初に削除
- このコマンドで
php72-php-pecl-zip.x86_64
をインストール - Apache リロード
- OK > 完了
■ Error 2
$ sudo yum -y install php72-php-xml
- OK > 完了
最後に
私の環境では上記で解決しました。