EC-CUBE 2.4.1の文字化け回避

ちょっくらEC-CUBEを触る事がありまして、最新版を入れたところ文字化けしましてね。
UTF-8でうまくいかなかったので、その回避の為の設定を記載します。
※あまり詳しくは書かないです

■環境
OS   : CentOS 5
Apache : 2.2.3
PHP   : 5.1.6
MySQL  : 5.0.22


1) EC-CUBEのファイルを展開する

# unzip eccube-2.4.1.zip


2) PHPの設定

# cd eccube-2.4.1/html
# vi .htaccess
php_value default_charset UTF8
php_flag magic_quotes_gpc Off
php_flag auto_detect_line_endings On
php_value output_handler mb_output_handler
php_value mbstring.language Japanese
php_flag mbstring.encoding_translation On
php_value mbstring.internal_encoding UTF-8
php_value mbstring.detect_order auto
php_value mbstring.substitute_character none
php_value mbstring.http_input auto
php_value mbstring.http_output pass
php_value upload_max_filesize 5M


3) MySQLでDBと接続ユーザを作成

# mysql -u root
mysql> create database test_db default character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on test_db.* to test_db_user@localhost identified by 'パスワード';
Query OK, 0 rows affected (0.04 sec)

4) ちょっとApacheの設定

DocumentRoot:eccube-2.4.1/html
に設定


5) EC-CUBEのDBアクセスファイルを編集

# cd eccube-2.4.1/data/class/
# vi SC_DbConn.php

                                                                                                • -

66行目付近にこれを追加
if (DB_TYPE == 'mysql') {
$objDbConn->query('SET NAMES utf8');
}

                                                                                                • -

6) EC-CUBEのインストール

http://example.com/install/index.php

これで大丈夫なはず・・・


でわ。