LoginSignup
3
1

More than 5 years have passed since last update.

Craft CMSをSierraに入れてハマった件

Last updated at Posted at 2017-03-10

背景

Craft CMSというのを仕事で使うために、手持ちのmacOS Sierraにインストール。Craft CMSの良さについてはアドベントカレンダーとかあるのでそこらへんを参照にするといいかもしれません。今回の仕事的には
- 軽量
- 投稿タイプとかの定義が標準でUIからできるので簡単
- でもDrupalほど設定にハマらなくていい。テーマの拡張もTwigとか利用しても簡単に書ける
そんなところが良いと判断されて採用されているようです。

この記事の環境

現在の私の環境は、
* macOS Sierra (10.12.3 (16D32))
* mysql 5.7.16
* php 5.6.29
* Craft CMS 2.6.2966

コケたポイント

1.Mcryptが設定されていなくてコケる

ここを参考にしました。
https://michaelgracie.com/2016/09/plugging-mcrypt-into-php-on-macos-sierra-10-12/

要はphpのモジュールをコンパイルして(なん年ぶりにモジュールコンパイルしたんだか!)インストールする。その時System Integrity Protection を外す、です。

2.craft cmsがインストールされているmysqlと互換性のないSQLを吐くのでコケる

インストールの途中、以下のような画面が出て死亡...
error.png

これだとエラーメッセージがちゃんと読めないので発見にちょっと時間がかかりました。
最終的にはWeb Inspectorを開いて、Networkタブの install というリソース(ajax通信の結果ですね)に以下のように出力されているのが確認できたので、先に進めました。

<h2>Internal Server Error</h2>

<p>CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #18 of SELECT list is not in GROUP BY clause and contains nonaggregated column &#039;tevatest.structureelements.root&#039; which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql&#95;mode=only&#95;full&#95;group&#95;by</p>

ここら辺を参考にしました。
http://craftcms.stackexchange.com/questions/12084/getting-this-sql-error-group-by-incompatible-with-sql-mode-only-full-group-by
http://qiita.com/hshimo/items/3e315dc102e3e47e4a98

craft cms3では治っているそうですね。

my.cnfは、とりあえず~/.my.cnfとして保存。
これでインストールが完了し、うまく動きました。

番外編

また2.にハマる前に気持ちわるいのでvirtualhostにしました。これは、なくていいのかはまだチェックしておりません。

3
1
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
3
1