LoginSignup
6

More than 5 years have passed since last update.

FuelPHPを使っていて「MYSQL_ATTR_COMPRESS」が定義されていないエラーと表示された時に対応

Last updated at Posted at 2012-09-20

FuelPHPでPDOを利用したMySQLアクセスを行おうとした際に「fuelphp Undefined class constant 'MYSQL_ATTR_COMPRESS'」とエラーがでた場合には、app/config/db.phpを修正すると良いです。

開発環境のみ無効にしたい場合にはapp/config/development/db.phpを修正すれば大丈夫です。

db.php
/**
 * Base config, just need to set the DSN, username and password in env. config.
 */
'default' => array(
    'type'        => 'pdo',
    'connection'  => array(
        'persistent' => false,
        'compress'   => false,
    ),
    'identifier'   => '`',
    'table_prefix' => '',
    'charset'      => 'utf8',
    'enable_cache' => true,
    'profiling'    => false,
),
  • defaultのconnectionに「 compress 」を追加。
  • compressの値を false に設定

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
6