LoginSignup
0
0

More than 5 years have passed since last update.

XSERVER BUSINESS環境へ「WP-CLI」をインストールする

Posted at

1. 「wp-cli」インストール

cd ~

# ディレクトリ作成
mkdir wp-cli

cd ~/wp-cli

# wp-cli.pharをダウンロード
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

# 実行権限付与
chmod +x wp-cli.phar

# 動作確認
php wp-cli.phar --info

2. 「wp-completion.bash」インストール

cd ~/wp-cli

wget https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash

3. 「.bash_profile」編集

cd ~

cp -ip .bash_profile .bash_profile.org

diff .bash_profile.org .bash_profile

vi .bash_profile
# 以下追記
source ~/wp-cli/wp-completion.bash

diff .bash_profile.org .bash_profile

source ~/.bash_profile

4. 「.bashrc」編集

cp -ip .bashrc .bashrc.org

diff .bashrc.org .bashrc

vi .bashrc
# 以下追記
alias wp='php ~/wp-cli/wp-cli.phar'

diff .bashrc.org .bashrc

. ~/.bashrc
0
0
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
0
0