I had a problem when I went to install the Lime Survey 4.1.17 com MySQL version 8.0.9.
The enviroment I'm using is Digital Ocean With MySQL as the Platform. In this environment, MySQL MyISAM is disabled and, therefore, I can only use InnoDB.
First error:
Message...
"Please fix the following input errors:
You need to enable large_file_prefix setting in your database configuration in order to use InooDb engine for LimeSurvey!
Your database configuration needs to have innodb_file_format and innodb_file_format_max set to use the Barracuda format in order to use InooDb engine for LimeSurvey!"
however, as it is MySQL version 8, these environment variables no longer exist.
So that I could proceed, I edited the file: ".application/models/InstallerConfigForm.php":
Where was:
Code:
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 order 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_format_max set to use the Barracuda format in order to use InnoDB engine for LimeSurvey!'));
}
}
I Changed to:
Code:
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 order 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_format_max set to use the Barracuda format in order to use InnoDB engine for LimeSurvey!'));
#}
$nothing = "Nothing";
}
I just commented not to make these checks.
Fix this, the following error: Database Connection error!
I notice that "$this->dblocation", when the port is specified, It brought port information in the host parameter, getting "{host=host:port}".
To Fix it, I edited the file".application/models/InstallerConfigForm.php" and made the following corrections:
Where was:
Code:
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;
}
I changed to:
Code:
private function getMysqlDsn() {
$port = $this->getDbPort();
$host = $this->getHost();
// 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={$host};port={$port};";
}
if ($this->useDbName) {
$sDSN .= "dbname={$this->dbname};";
}
return $sDSN;
}
Creating the function:
Code:
/**
* Get the host
* @return string
*/
public function getHost()
{
if (strpos($this->dblocation, ':') !== false) {
$pieces = explode(':', $this->dblocation, 2);
if (isset($pieces[1]) && is_numeric($pieces[1])) {
return $pieces[0];
}
}
return $this->dblocation;
}
This way, I was able to proceed and complete the installation.
I believe that this code must be reviewed by the developers to correct this and other erros.
Then, share the
workaround.
Regards.