LoginSignup
8
7

More than 5 years have passed since last update.

エックスサーバーにWP-CLIをインストール

Last updated at Posted at 2018-05-07

WP-CLIのインストール

置換はWP-CLIで行う

エックスサーバーでSSHの接続設定がしていない場合は設定する

$ cd ~
$ mkdir bin
$ cd bin
$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
$ chmod +x wp-cli.phar

ちゃんとインストールされたか確認

$ wp-cli.phar --info

wp コマンドが使えるように wp にエイリアスを張る

$ echo 'alias wp="~/bin/wp-cli.phar"' >> ~/.bashrc
# 環境によっては上記でなく下記
$ echo 'alias wp="/opt/php-7.1.2/bin/php ~/bin/wp-cli.phar"' >> ~/.bashrc
$ source ~/.bashrc

参考文献

https://qiita.com/kkotaro0111/items/26221712625e79c3ba8d
https://qiita.com/youcune/items/5803344dcf06b234c31b

8
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7