Help us understand the problem. What is going on with this article?

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

More than 5 years have passed since last update.

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 に設定
ariela
はいぱーへたれえんじにあ
http://transrain.net/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした