現役プログラマのWordPressカスタマイズ相談

WordPress(ワードプレス)のお悩み、うまくいかなくてお困りなこと、不具合調査、新規制作依頼まで、ウェブアプリケーションエンジニアがあなたをサポートします。

WordPressプラグインRinkerの商品検索ができなかった件(自サーバーの環境問題)

f:id:jsaz:20190212234132p:plain:w480

あれ、動かない。。。

Rinkerの商品検索(amazon)が動きません。

amazonトークンやキーはあっている。。。

ソースコード追っかけてみました。

リクエストのURLを抜き出して、ブラウザに貼り付けて実行すると上手くいきます。

怪しいと思い「simplexml_load_string php7」で検索するとSimpleXMLが入っていないことがわかった。

ubuntuのパッケージ検索 https://packages.ubuntu.com/ja/

私のサーバーはphp7.2なので、「php7.2-xml」で検索してみる。

php7.2-xml を入れれば良いらしい

$ sudo apt-get install php7.2-xml
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  php7.2-xml
0 upgraded, 1 newly installed, 0 to remove and 26 not upgraded.
Need to get 107 kB of archives.
After this operation, 456 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 php7.2-xml amd64 7.2.14-1+ubuntu18.04.1+deb.sury.org+1 [107 kB]
Fetched 107 kB in 1s (91.8 kB/s)
Selecting previously unselected package php7.2-xml.
(Reading database ... 143503 files and directories currently installed.)
Preparing to unpack .../php7.2-xml_7.2.14-1+ubuntu18.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php7.2-xml (7.2.14-1+ubuntu18.04.1+deb.sury.org+1) ...
Setting up php7.2-xml (7.2.14-1+ubuntu18.04.1+deb.sury.org+1) ...

Creating config file /etc/php/7.2/mods-available/dom.ini with new version

Creating config file /etc/php/7.2/mods-available/simplexml.ini with new version

Creating config file /etc/php/7.2/mods-available/wddx.ini with new version

Creating config file /etc/php/7.2/mods-available/xml.ini with new version

Creating config file /etc/php/7.2/mods-available/xmlreader.ini with new version

Creating config file /etc/php/7.2/mods-available/xmlwriter.ini with new version

Creating config file /etc/php/7.2/mods-available/xsl.ini with new version
Processing triggers for php7.2-fpm (7.2.14-1+ubuntu18.04.1+deb.sury.org+1) ...

こんな感じでインストール完了

無事動くようになりました。 キーなどを疑っていたので無駄に時間を使っちゃいました。

この記事を見ているあなた、お困りなことあればお気軽にご連絡ください!