※当サイトの記事には、広告・プロモーションが含まれます。

Windows 10 HomeにVCCWを導入までの道のり(いろいろ解決できず、翌日解決したかも)

WordPressの本番環境をローカルのXAMPPに移行した際に、ローカルのログイン画面から本番環境にリダイレクトされてしまう現象が起こりました。

WinSCPWordPressの本体ごとダウンロードし、本番サーバのphpMyAdminからデータベースのエクスポートでSQLファイルをダウンロードして、サクラエディタでURLをローカルのものに置換したのですが、上手くいかずでした。

VCCW(Vagrant Chef Centos Wordress)など

WordPressもくもく会というものに参加せていただいたときに教えてもらったのですが、本番環境とローカル環境を同じ状態にしたい場合にVCCWというものを導入すると良いみたいです。

WordPressの環境構築で使える方法

  • Vagrantベース
    • VCCW v2(Vagrant Chef CentOS Wordress)

      Apacheを使っているようです。

    • VVV(Varying Vagrant Vagrants)

      Nginxを使っているようです。

  • Dockerベース
  • 仮想化じゃない場合

※ VCCW v3からは、OSがUbuntuになったようで、Vagrant Chef ○○ Wordressのもう1つのCの部分はどうなるんでしょうね?

ChefもAnsibleに変わったらしいのでVagrant ×× ○○ Wordressで、Cが...無くなってる?

VCCW v3での変更点と新機能まとめ - Qiita

VCCW - A WordPress development environment.

VagrantとChefって?

Vagrant 

仮想環境としてVM仮想マシン)を起ち上げるには、VirtualBoxVMWare などの仮想化ソフトを利用しますが、VMの構成(OSやサーバなどの種類、バージョン)や設定(ネットワークなど)などが人それぞれで統一されないことがあります、人間だもの。

そんな状況を回避するために、誰が実行しても同じ仮想開発環境になるように管理してくれるソフトらしいです。

Vagrant(ベイグラント)

FLOSS仮想開発環境構築ソフトウェアVirtualBoxをはじめとする仮想化ソフトウェアやChef や SaltPuppetといった構成管理ソフトウェアのラッパーとみなすこともできる。

Vagrantを用いると、構成情報を記述した設定ファイルを元に、仮想環境の構築から設定までを自動的に行うことができる。当初はVirtualBoxをターゲットとしていたが、1.1以降のバージョンではVMwareなどの他の仮想化ソフトウェアやAmazon EC2のようなサーバー環境も対象とできるようになった。

Vagrant自身はRubyで作成されているが、PHPPythonJavaC#JavaScriptといった、他のプログラミング言語の開発においても用いることができる。

バージョン1.6以降ではデプロイツールのDockerがネイティブサポートされており、これによりDockerが軽量LXCコンテナを使う際のオーバーヘッドが削減されている。

またvagrant-libvirtプラグインにより、仮想化管理用APIlibvirtもサポートされている。

Vagrant (ソフトウェア) - Wikipedia

VagrantとDockerについて名前しか知らなかったので試した - Qiita

開発環境の構築・共有を簡単にするVagrant入門 | Think IT(シンクイット)

 

Chef 

サーバーの構成管理ツール。設定ファイルを作成することでサーバ設定や更新を自動化してくれるようです。Chef以外にも様々なサーバー構成管理ツールがあるようです。 

  • Chef
  • Ansible
  • Puppet
  • Itamae

ベンダー/コミュニティ

Chef Chef Software, Inc.
Ansible Red Hat Inc.
Puppet Puppet Labs
Itamae itamae-kitchen

使用言語

Chef Ruby
Ansible Python
Puppet Ruby
Itamae Ruby

設定ファイル

Chef 独自(Rubyを使ったDSL
Ansible YAML
Puppet 独自(Rubyを使ったDSL
Itamae 独自(Rubyを使ったDSL

主なインストール手法

Chef rpm/deb(専用パッケージを提供)
Ansible pip
Puppet yum/apt-get(専用リポジトリを提供)
Itamae gem

特徴

Chef サーバnode内で設定を行うChef、管理サーバからChefを実行するknife、集中管理を行うChef Serverなどで構成。
Ansible リモート側にインストールする必要がないため(エージェントレス)、ホスト側だけで利用できる。
ホスト側からリモート側の操作を行うPush型。
ログもホスト側に集約されるため、障害解析のためリモート側を個別にみる必要が少ない。
リモート側にエージェント経由や、ポートを別途開いて接続するのではなく、SSHを使って接続する設計。
Puppet node側から処理が実行されるpull型
Itamae SSH経由およびリモートにインストールされたItamae経由

最近のインフラ系ツールが多すぎて何が何だかわからない!からの卒業 - Qiita

[構成管理ツール][プロビジョニング]chef,puppet,itamae,ansibleらあるけどメリットデメリットまとめてみた – ADACHIN SERVER Lab

実際に検証済み!OSS徹底比較(3)サーバ構築自動化【前編】:OSSのサーバ構築自動化ツール、4製品徹底検証 2016年版 (1/9) - @IT

業務でWebサービス開発をする際に気をつけたいこと(新卒向け) - Qiita

 

VCCVを導入してみる

なにはともあれ、

の2つがないと始まらないようです。

 

Vagrantインストール 

https://www.vagrantup.com/ にアクセスし、『DOWNLOAD 1.9.4』を選択します。

f:id:ts0818:20170513151414j:plain

お使いのOSに合わせたものを選択します。自分はWindowsを選択しました。旧いバージョンを使いたい場合などは、『download older versions of Vagrant』というリンクを選択すれば良さそうです。

f:id:ts0818:20170513151413j:plain

ダウンロードされた実行ファイル(vagrant_1.9.4.msi)をダブルクリックします。

1.9.4のバージョンはいろいろ不具合があるみたいで、1.9.5が出るまでは、1.9.4以外を使うのが良いみたいです、自分は1.9.4選択してしまいましたが(涙)。

f:id:ts0818:20170513151412j:plain

同意して、『Next』を選択します。

f:id:ts0818:20170513151411j:plain

インストール場所を決めて『Next』。自分はデフォルトのままにしました。

f:id:ts0818:20170513151410j:plain

『Install』を選択します。

f:id:ts0818:20170513152142j:plain

インストールが始まります。

f:id:ts0818:20170513152141j:plain

『Finish』を選択します。

f:id:ts0818:20170513152140j:plain

パソコンの再起動を求められるので『Yes』を選択します。

f:id:ts0818:20170513152139j:plain

VirtualBoxのインストール 

すみません、自分は既にVirtualBoxをインストール済みなのでVirtualBoxのインストールについては割愛させていただきます。

自分の使ってるバージョンは、5.1.18r114002 のようです。

f:id:ts0818:20170514105306j:plain

⇩  VirtualBoxのインストールは下記サイトが参考になりそうです。

【初心者でもわかる】VirtualBoxインストール方法を詳しく!

 

Vagrantを使ってみる

まずは、インストールされたかの確認と、 vagrant-hostsupdaterというプラグイン仮想マシン起動時にhostsというファイルの登録処理をしてくれる)を導入します。

vagrant-hostsupdaterを入れれば、WindowsでC:¥Windows¥System32¥drivers¥etc¥hostsファイルを手動で編集する必要はなくなるみたいです。(自分はhostsファイル触ってません。)

ConEmuでBashを起動し、コマンドを入力。(途中で、管理者権限が必要なところが出てきたので、bashも管理者権限で実行しておいたほうが良さそうです。)

開いているタブの上で右クリックして『Restart of duplicate』>『Duplicate root...』を選択で管理者権限で実行できます。

f:id:ts0818:20170514092747j:plain

vagrant -v
vagrant plugin install vagrant-hostsupdater

 

f:id:ts0818:20170513161625j:plain

⇩  コマンドプロンプトは使わないほうが良いみたいです

いますぐコマンドプロンプトを捨てて、Cygwinを使うべき10+の理由 - それマグで!

【CygwinとGowの違い】Windows10でLINUXコマンドを使いたいからGowを導入してみた | SakanaTech

MSYS、MSYS2、Cygwin、msysgit の違い: 雨鯨のたそがれ

 

VCCVを導入

まずは、適当な場所にプロジェクト用のフォルダを作っておきます。今回は、E:¥vagrant_testを用意しました。

f:id:ts0818:20170513163701j:plain

コマンドでE:¥vagrant_testに移動した後、 

githubに上がっているVCCWのデータをローカルにコピーします。これで仮想マシンまで作成されるようです。

2017年5月20日 追記

Windowsでvccwを導入する場合は、git clone は使わず、zipファイルを直接ダウンロードするのが良いみたいです。

Vagrant+Virturlbox+VCCWの使い方(Mac/Windows) | コムテブログ

 

cd /E/vagrant_test
git clone https://github.com/vccw-team/vccw.git

 

f:id:ts0818:20170513163700j:plain

 vccvフォルダがインストールされました。 

f:id:ts0818:20170513164327j:plain

 

site.ymlを作成してvccwフォルダに設置

このsite.ymlというファイルを置いておくと、後ほど仮想マシンを起動する際に設定を読み込んでくれるようです。

 

cd /E/vagrant_test/vccv
cp provision/default.yml ./site.yml

f:id:ts0818:20170513164722j:plain

site.ymlファイルの内容を一部変更します。

vi site.yml
/hostname

f:id:ts0818:20170513165819j:plain

hostnameを変更します。

hostname: vagrant-test.dev #任意でOK    

※hostnameに『_(アンダーバー)』は使えないので注意しましょう。

There are errors in the configuration of this machine. Please fix the following errors and try again: vm: * The hostname set for the VM should only contain letters, numbers, hyphens or dots. It cannot start with a hyphen or dot.

Vagrantfileでhostnameを指定したときのメモ - Qiita

続いて、「lang」を検索。

/lang

f:id:ts0818:20170513170438j:plain

日本語に変更しましょう。

lang: ja

変更が終了したら、:wqで保存してviを終了します。

仮想マシンの状態を確認します。

vagrant status

not created(virtualbox)って、見事に止まってる!?というか作成されてない?

vagrantVirtualBoxの関連付けをしているファイルが無い、もしくは中身が空の状態になっている事が原因らしいので、『E:¥vagrant_test¥vccw¥.vagrant¥machines¥vagrant-test.dev¥virtualbox』を確認。

 ls -la .vagrant/machines/vagrant-test.dev/virtualbox/

f:id:ts0818:20170513173500j:plain

ファイルがないみたいで、ここにファイルを作成してやればいいのですが、VirtualBox側のVMのUUIDを調べる必要があるようです。

VirtualBoxVMのUUIDの調べ方

コマンドプロンプトを立ち上げて、VirtualBoxのインストールディレクトリへ移動

cd C:\Program Files\Oracle\VirtualBox

VBoxManageでVirtualBoxにあるVMのUUIDの一覧を確認

VBoxManage.exe list vms

f:id:ts0818:20170513174656j:plain

bashに戻って、E:¥vagrant_test¥vccw¥.vagrant¥machines¥vagrant-test.dev¥virtualbox¥idファイルを作成します。

vi .vagrant/machines/vagrant-test.dev/virtualbox/id

f:id:ts0818:20170513175203j:plain

idファイルの先頭に調べたUUIDを書いて保存します。

idファイルの編集が済んだら、vagrant側のステータスを確認します。

vagrant status

f:id:ts0818:20170513180139j:plain

仮想マシンが認識されました!再度、vagrant upを実行し、vagrant statusを実行します。

f:id:ts0818:20170513180140j:plain

今度は動きました!

ただ、vagrant upで気になる点が...

C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:54:in `readpartial': An established connection was aborted by the software in your host machine. (Errno::ECONNABORTED)

error出とりますやん!

下記サイトで対応方法が掲載されていました。

Vagrant で rubygems エラー - demandosigno

対応後、今度は違うエラーが!

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "9a153f01-ec65-412b-b135-c71d1172ccd2", "--natpf1", "delete", "ssh"]

Stderr: VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 507 of file VBoxManageModifyVM.cpp

⇩ 下記サイトを参考にVagrantfileファイルを修正

Windows10でVagrant+VMwareでCentOS6を構築する – けんじの作業ログ

 が、解決できず。

無念の一回、仮想マシンを削除することに。

vagrant destroy

不要な Vagrant 仮想マシンを削除する (vagrant destroy) | まくまく Vagrant ノート

インストールされていた一旦vccwのフォルダも根こそぎ削除。

再び、vccwをgit cloneした後、今回はsite.ymlを作る前にvagrant upしたら、むっちゃエラーが!!!

failed: [vagrant-wordpress] (item=wp-coding-standards/wpcs:*) => {"failed": true, "item": "wp-coding-standards/wpcs:*", "msg": "./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) 
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: remove squizlabs/php_codesniffer 3.0.0
- Conclusion: don't install squizlabs/php_codesniffer 3.0.0
- wp-coding-standards/wpcs 0.3.0 requires squizlabs/php_codesniffer ~2.0 -> satisfiable by squizlabs/php_codesniffer[2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].
- wp-coding-standards/wpcs 0.4.0 requires squizlabs/php_codesniffer ~2.0 -> satisfiable by squizlabs/php_codesniffer[2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].
- wp-coding-standards/wpcs 0.5.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].
- wp-coding-standards/wpcs 0.6.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].
- wp-coding-standards/wpcs 0.7.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].
- wp-coding-standards/wpcs 0.7.1 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].
- wp-coding-standards/wpcs 0.8.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].
- wp-coding-standards/wpcs 0.9.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].
- wp-coding-standards/wpcs 0.10.0 requires squizlabs/php_codesniffer ^2.6 -> satisfiable by squizlabs/php_codesniffer[2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].
- wp-coding-standards/wpcs 0.11.0 requires squizlabs/php_codesniffer ^2.8.1 -> satisfiable by squizlabs/php_codesniffer[2.8.1, 2.9.0].
- Can only install one of: squizlabs/php_codesniffer[2.0.0, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.1.0, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.2.0, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.3.0, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.3.1, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.3.2, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.3.3, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.3.4, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.4.0, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.5.0, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.5.1, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.6.0, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.6.1, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.6.2, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.7.0, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.7.1, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.8.0, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.8.1, 3.0.0].
- Can only install one of: squizlabs/php_codesniffer[2.9.0, 3.0.0].
- Installation request for squizlabs/php_codesniffer (locked at 3.0.0, required as *) -> satisfiable by squizlabs/php_codesniffer[3.0.0].
- Installation request for wp-coding-standards/wpcs * -> satisfiable by wp-coding-standards/wpcs[0.10.0, 0.11.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.7.1, 0.8.0, 0.9.0].
Installation failed, reverting ./composer.json to its original content.", "stdout": "./composer.json has been updated\n
Loading composer repositories with package information\n
Updating dependencies (including require-dev)\n
Your requirements could not be resolved to an installable set of packages.\n\n
Problem 1\n
- Conclusion: remove squizlabs/php_codesniffer 3.0.0\n
- Conclusion: don't install squizlabs/php_codesniffer 3.0.0\n
- wp-coding-standards/wpcs 0.3.0 requires squizlabs/php_codesniffer ~2.0 -> satisfiable by squizlabs/php_codesniffer[2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].\n
- wp-coding-standards/wpcs 0.4.0 requires squizlabs/php_codesniffer ~2.0 -> satisfiable by squizlabs/php_codesniffer[2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].\n
- wp-coding-standards/wpcs 0.5.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].\n
- wp-coding-standards/wpcs 0.6.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].\n
- wp-coding-standards/wpcs 0.7.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].\n
- wp-coding-standards/wpcs 0.7.1 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].\n
- wp-coding-standards/wpcs 0.8.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].\n
- wp-coding-standards/wpcs 0.9.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].\n
- wp-coding-standards/wpcs 0.10.0 requires squizlabs/php_codesniffer ^2.6 -> satisfiable by squizlabs/php_codesniffer[2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].\n
- wp-coding-standards/wpcs 0.11.0 requires squizlabs/php_codesniffer ^2.8.1 -> satisfiable by squizlabs/php_codesniffer[2.8.1, 2.9.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.0.0, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.1.0, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.2.0, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.3.0, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.3.1, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.3.2, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.3.3, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.3.4, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.4.0, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.5.0, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.5.1, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.6.0, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.6.1, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.6.2, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.7.0, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.7.1, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.8.0, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.8.1, 3.0.0].\n
- Can only install one of: squizlabs/php_codesniffer[2.9.0, 3.0.0].\n
- Installation request for squizlabs/php_codesniffer (locked at 3.0.0, required as *) -> satisfiable by squizlabs/php_codesniffer[3.0.0].\n
- Installation request for wp-coding-standards/wpcs * -> satisfiable by wp-coding-standards/wpcs[0.10.0, 0.11.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.7.1, 0.8.0, 0.9.0].\n\n\n
Installation failed, reverting ./composer.json to its original content.\n",
"stdout_lines": ["./composer.json has been updated",
"Loading composer repositories with package information",
"Updating dependencies (including require-dev)",
"Your requirements could not be resolved to an installable set of packages.",
"",
" Problem 1",
" - Conclusion: remove squizlabs/php_codesniffer 3.0.0",
" - Conclusion: don't install squizlabs/php_codesniffer 3.0.0",
" - wp-coding-standards/wpcs 0.3.0 requires squizlabs/php_codesniffer ~2.0 -> satisfiable by squizlabs/php_codesniffer[2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].",
" - wp-coding-standards/wpcs 0.4.0 requires squizlabs/php_codesniffer ~2.0 -> satisfiable by squizlabs/php_codesniffer[2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].",
" - wp-coding-standards/wpcs 0.5.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].",
" - wp-coding-standards/wpcs 0.6.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].",
" - wp-coding-standards/wpcs 0.7.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].",
" - wp-coding-standards/wpcs 0.7.1 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].",
" - wp-coding-standards/wpcs 0.8.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].",
"
- wp-coding-standards/wpcs 0.9.0 requires squizlabs/php_codesniffer ~2.2 -> satisfiable by squizlabs/php_codesniffer[2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].",
"
- wp-coding-standards/wpcs 0.10.0 requires squizlabs/php_codesniffer ^2.6 -> satisfiable by squizlabs/php_codesniffer[2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.1, 2.8.0, 2.8.1, 2.9.0].",
"
- wp-coding-standards/wpcs 0.11.0 requires squizlabs/php_codesniffer ^2.8.1 -> satisfiable by squizlabs/php_codesniffer[2.8.1, 2.9.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.0.0, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.1.0, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.2.0, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.3.0, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.3.1, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.3.2, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.3.3, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.3.4, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.4.0, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.5.0, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.5.1, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.6.0, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.6.1, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.6.2, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.7.0, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.7.1, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.8.0, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.8.1, 3.0.0].",
"
- Can only install one of: squizlabs/php_codesniffer[2.9.0, 3.0.0].",
"
- Installation request for squizlabs/php_codesniffer (locked at 3.0.0, required as *) -> satisfiable by squizlabs/php_codesniffer[3.0.0].",
"
- Installation request for wp-coding-standards/wpcs * -> satisfiable by wp-coding-standards/wpcs[0.10.0, 0.11.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.7.1, 0.8.0, 0.9.0].",
"",
"",
"Installation failed, reverting ./composer.json to its original content."]}

でも、http://vccw.dev/ にアクセスしたら、WordPressが表示されたけど~?

 

f:id:ts0818:20170513214741j:plain

⇩ 下記サイトを参考に、site.ymlを改めて作成。

WordPressをVagrant環境にらくらくインストールする。 - VCCW - Qiita

 vagrant reload --provision

が、エラー?っぽいメッセージが。

==> vagrant-wordpress: [vagrant-hostsupdater] Removing hosts
==> vagrant-wordpress: [vagrant-hostsupdater] No machine id, nothing removed from C:/WINDOWS/system32/drivers/etc/hosts
==> vagrant-wordpress: VM not created. Moving on...
==> vagrant-wordpress: [vagrant-hostsupdater] Checking for host entries

vagrant upを強行!再度ブラウザにアクセス。今度はhostnameを変更したのでhttp://vagrant-wordpress/ でアクセス。はできたけど、管理画面にログインすると前のhostnameになってしまう...。

管理画面には、自分の場合だとhttp://vagrant-wordpress/wp-login.phpにアクセスしてsite.ymlに書いてある、# WordPress Userのところのadmin_userとadmin_passの値を入力すればログインできます。

f:id:ts0818:20170513233008j:plain

管理画面が前のvccw.devのままになってしまう! 日本語化もされてないし!site.ymlの設定で反映されてるのがサイト表示のhostnameだけだし、管理画面でhostnameの設定反映されてないし。

f:id:ts0818:20170513233007j:plain

しばらく、解決でき無さそう....。 

ちなみに、VirtualBoxのバージョンは5.1.18かな?

f:id:ts0818:20170514000019j:plain

あと、気になったのはVCCW入れたのに、ssh接続先がUbuntu 16.04.1って...CentOSじゃないの?sshコマンドでもcommand not foundとか出てるし(ssh接続自体はできてるようです)、いろいろ駄目な気がします。

Windows でのテキストファイルは改行コードが CRLF(=0x0d,0x0a) なのに対し、 UNIX では LF (=0x0a) のため起きる問題のようです。

Cygwin memo

色々な改行コード変換の方法 - Qiita

CentOS7 dos2unixコマンドを使った改行コード変換

[Linux] dos2unix,unix2dosは標準でインストールされていないので追加インストールする · GitHub

備忘録: 【LINUX】テキストファイルの改行コード変換【unix2dosと、dos2unixコマンド】

-bash: /home/vagrant/.bash_profile: line 9: syntax error near unexpected token `$'do\r''
'bash: /home/vagrant/.bash_profile: line 9: `  for f in "${HOME}"/.bash.d/*.sh ; do

f:id:ts0818:20170514001922j:plain

 

 

備忘録: vagrantからVirtualBoxが起動出来なくなる問題の解決方法 

web帳 | 【WordPress】 VVV(Varying-Vagrant-Vagrants)を使った 最強ローカル環境構築!!

VCCW: WordPressのローカル環境をChefsで作りましょう!

vccwとWordMoveでWordpress開発が便利になるし勉強にもなるよという話 | codechord

 

2017年5月14日 追記

1日経って、CCleanerを実行してChromeとか一旦閉じた後に、vagrant upし直したら、エラーも出ず、site.ymlも反映されました。

f:id:ts0818:20170514103901j:plain

何だったんだろう...vagrant 怖い。 

 

2017年5月16日 追記

VCCWのCはCentOSってネットの情報を見ていて、VCCWにv2系とv3系があるのを知らなくて、ずっとCentOSだと思い込んでてて違和感があったけど、v3がインストールされてたからUbuntuになってたようです、自分を含め初心者には分かりづらいですね。

つまり、v3系をインストールしてたのに、v2系の手順でやろうとしていたので、movefileとかが自動でできなかったということですかね、う~ん、分から~ん。

今回はこのへんで。