Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What is going on with this article?
@Ayame

WordpressをCentOS 7(Apache)にwp-cliを使ってコマンドラインで導入

More than 3 years have passed since last update.

wp-cliでsshから簡単にWordpressインストール・初期設定。
ただ、themeコマンドがうまく使えなかったので原因検証中

wp-cliインストール

rootで実行

  • wp-cliをダウンロード
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
  • 動作確認
php wp-cli.phar --info
  • 実行権限を付与してパスを通す
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
  • 動作確認
wp --info

うまく動いているとこんな感じに出るはず

PHP binary: /usr/bin/php
PHP version:    7.*.*
php.ini used:   /etc/php.ini
WP-CLI root dir:    phar://wp-cli.phar
WP-CLI packages dir:    
WP-CLI global config:   
WP-CLI project config:  
WP-CLI version: 1.1.0

Bash補完を登録

使用ユーザーで

  • wp-completion.bashをダウンロードして.bashに保存
curl -O https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash
mkdir .bash
mv wp-completion.bash .bash/wp-completion.bash
  • .bash_profileを編集し末尾に追加
vim ~/.bash_profile
source ~/.bash/wp-completion.bash

WordPressインストール

  • HTMLファイル所有ユーザーで、WordPressのルートディレクトリに移動
  • WordPressダウンロード
wp core download --locale=ja
  • データベース設定 (PHPMyAdmin等であらかじめユーザーとデータベースを作成しておく)
wp core config --dbname=[DB名] --dbuser=[DBユーザー名] --dbpass=[DBパスワード] --dbhost=[DBホスト名] --dbprefix=[テーブル接頭辞 default: wp_]
  • インストール
wp core install --url=[ホスト名] --title=[タイトル] --admin_user=[管理ユーザー名] --admin_password=[管理ユーザーパスワード] --admin_email=[管理者メールアドレス]

参考

2
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
2
Help us understand the problem. What is going on with this article?