OctoberCMSインストールしてみた

Laravelの話をしていたらOctoberCMSを紹介されたのでインストールしてみた。
やっとこさできました。

インストール

参考2のようにcomposerで。

$ composer create-project october/october october dev-master

app/config/app.phpはurlを変えるくらいでいいかなと。
app/config/cms.phpもそのままで。

$ php artisan october:up

ん?なんかコンソールに警告でたぞ。
まあいいや。参考3にあるようにアクセスしてみよう。
http://***.***.***.***/~mfham/october/index.php
エラー・・・えらーいこっちゃ><

やったこと

DB、ユーザ作成

参考3にはちょろっと書いてありますが、私はDB等作らずにやっていました。
作りました。

# 権限絞ったほうがいいのかな
# 最初select, delete, update, insertだけ許可してたら、alterできませんって後でエラーが出ました
mysql>  GRANT ALL ON *.* TO october@"localhost";
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> create database october;

そしてapp/config/database.phpに上記設定を書く。

その後URLに再度アクセスしてみる。

SQLSTATE[HY000] [2002] No such file or directory

ソースをgrepする。必死にググる。なんとなく原因分かる。
app/config/database.phpに設定追加

# mysql.sockの場所追加
'mysql' => array(
            'driver'    => 'mysql',
                  ・
                  ・
                  ・
            'prefix'    => '',
            'unix_socket' => '/tmp/mysql.sock', # add this parameter
        ),

そうだ、october:upしなきゃ。忘れてた。

$ php artisan october:up

お!さっきとはコンソールに出力されたものが違う!successfully!

再びURLにアクセス。見れた。
~/index.php/backendも見れた。

結論

  • database.phpにちゃんと設定を書く。
    • mysql.sockの場所は必要があれば?

backendにログインすると、以下のメッセージが表示されていました。

There are issues you need to pay attention to in order to configure the system properly.
Directory /themes or its subdirectories is not writable for PHP. Please set corresponding permissions for the webserver on this directory.
Directory /uploads or its subdirectories is not writable for PHP. Please set corresponding permissions for the webserver on this directory.
Directory /uploads/public or its subdirectories is not writable for PHP. Please set corresponding permissions for the webserver on this directory.
Directory /uploads/protected or its subdirectories is not writable for PHP. Please set corresponding permissions for the webserver on this directory.

親切。

$ sudo chown -R apache:apache themes/
$ sudo chown -R apache:apache uploads/