ユーザ用ツール

サイト用ツール


linux:limesurvey
no way to compare when less than two revisions

差分

このページの2つのバージョン間の差分を表示します。


linux:limesurvey [2020/11/24 13:21] (現在) – 作成 Wiki Editor
行 1: 行 1:
 +====== LimeSurvey関係 ======
 +
 +オープンソースのWebアンケートサーバ「LimeSurvey」のインストール時のポイント。
 +
 +MySQLのバージョンを8系にしてInnodbを利用しようとすると、インストールスクリプトの要件チェックではじかれる。これらのチェックを無効化してやり過ごす。
 +
 +application/models/InstallerConfigForm.php
 +
 +    public function validateDBEngine($attribute)
 +    {
 +        if ($this->isMysql
 +            && ($this->dbengine === null or !in_array($this->dbengine, array_keys($this->dbEngines)))) {
 +            $this->addError($attribute, gT('The database engine type must be set for MySQL'));
 +        }
 +        
 +        #if ($this->isMysql && $this->dbengine === self::ENGINE_TYPE_INNODB) {
 +        #    if (!$this->isInnoDbLargeFilePrefixEnabled()) {
 +        #        $this->addError($attribute, gT('You need to enable large_file_prefix setting in your database configuration in o\rder to use InnoDB engine for LimeSurvey!'));
 +        #    }
 +        #    if (!$this->isInnoDbBarracudaFileFormat()) {
 +        #        $this->addError($attribute, gT('Your database configuration needs to have innodb_file_format and innodb_file_for\mat_max set to use the Barracuda format in order to use InnoDB engine for LimeSurvey!'));
 +        #    }
 +        #}
 +    }
 +
 +以前のバージョンで設定しなければならないオプションはMySQL8では廃止されているため、値がセットされていないような状況になってインストールが進められない。チェックしているロジックをすべてコメントアウトして対応。
 +
 +もう一つの躓きポイントは単なるバグ。ネットワーク経由でDBに接続するのではなく、ソケットを利用する場合DSNの構築にミスがありうまく接続できない。
 +
 +    private function getMysqlDsn() {
 +    
 +        $port = $this->getDbPort();
 +        
 +        // MySQL allow unix_socket for database location, then test if $sDatabaseLocation start with "/"
 +        if (substr($this->dblocation, 0, 1) == "/") {
 +            $sDSN = "mysql:unix_socket={$this->dblocation};";
 +        } else {
 +            $sDSN = "mysql:host={$this->dblocation};port={$port};";
 +        }
 +        
 +        if ($this->useDbName) {
 +            $sDSN .= "dbname={$this->dbname};";
 +        }
 +        return $sDSN;
 +    }
 +
 +上記の関数の「$sDSN = "mysql:unix_socket={$this->dblocation}";」を「$sDSN = "mysql:unix_socket={$this->dblocation}__;__";」にする。「;」が1つ抜けているため、そのままDSNを構築するとソケットファイル名に続くパラメータが区切り文字なしに結合されてしまい、DBに接続できなくなる。バグ報告は暇を見つけてやっておきたい。
 +
  
linux/limesurvey.txt · 最終更新: 2020/11/24 13:21 by Wiki Editor

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki