utf8 warning at installation step 4

Install and configure FormaLMS and DoceboCE
lwescott
Newbie
Posts: 12
Joined: Mon Mar 07, 2022 8:14 pm

utf8 warning at installation step 4

Post by lwescott »

Hi,

Newbie here, first time install. I am trying to install FormaLMS 2.4.5 on a LAMP stack running Apache 2.4.52, MySQL 8.0.28, PHP 7.0.33 on Ubuntu 20.04.

I run the installation wizard and in step 4 it tells me my database is not UTF8.

I went as far as to create a new db in MySQL, using this:
CREATE DATABASE formalms2 CHARACTER SET utf8 COLLATE utf8_general_ci;

However, I still get this error: "The specified database is not utf8 charset." on step 4 of the config wizard.

I didn't find anything useful in the forums. If I didn't look properly, feel free to point me in the right direction. I've been banging my head against the wall on this for a couple of hours and I am getting nothing but a headache.

I'm missing something... any ideas?

Thanks,

Larry
alfa24
Senior Boarder
Posts: 2020
Joined: Fri Nov 24, 2017 8:45 am

Re: utf8 warning at installation step 4

Post by alfa24 »

Can you run this query on dB?

show variables like 'character_set_database'
Per supporto GRATUITO contattatemi in privato qui
lwescott
Newbie
Posts: 12
Joined: Mon Mar 07, 2022 8:14 pm

Re: utf8 warning at installation step 4

Post by lwescott »

Hi,

It tells me (of course) that the character set on the database is utf8mb4. hmm... Looking for ways to correct that.

Larry
lwescott
Newbie
Posts: 12
Joined: Mon Mar 07, 2022 8:14 pm

Re: utf8 warning at installation step 4

Post by lwescott »

Hi,

When I do

'SELECT SCHEMA_NAME 'database', default_character_set_name 'charset', DEFAULT_COLLATION_NAME 'collation' FROM information_schema.SCHEMATA;'

It shows that my formalms database is UTF8 with collation utf8_general_ci...

But the result of the query 'show variables like 'character_set_database' returns a value of 'utf8mb3'

(my previous post was incorrect)

Thanks,

Larry
alfa24
Senior Boarder
Posts: 2020
Joined: Fri Nov 24, 2017 8:45 am

Re: utf8 warning at installation step 4

Post by alfa24 »

The installer wants character_set_database variable to be utf8, not utf8mb3.
You may bypass it in /install/controllers/Step4Controller.php, function checkDBCharset
Per supporto GRATUITO contattatemi in privato qui
lwescott
Newbie
Posts: 12
Joined: Mon Mar 07, 2022 8:14 pm

Re: utf8 warning at installation step 4

Post by lwescott »

Hi,

I adjusted the function and was able to get past the problem. THANK YOU for your help!
Not critical, but do you any idea why that the page for Step 7 comes up in Italian?

I was able to complete the install, so you saved me and I really appreciate your willingness to help.
I am able to log into the system now.

Thanks!!

Larry Wescott
alfa24
Senior Boarder
Posts: 2020
Joined: Fri Nov 24, 2017 8:45 am

Re: utf8 warning at installation step 4

Post by alfa24 »

I don't remember of your issue, but I didn't find anything in the code. I searched for hardcoded Italian (Forma developers are Italian, as I am) with no apparent luck. If you can post a screenshot, I can confirm. Otherwise, let's wait my next install for a customer :)
Per supporto GRATUITO contattatemi in privato qui
lwescott
Newbie
Posts: 12
Joined: Mon Mar 07, 2022 8:14 pm

Re: utf8 warning at installation step 4

Post by lwescott »

Here is the screenshot.
Attachments
Forma Step 7 in Italian.jpg
alfa24
Senior Boarder
Posts: 2020
Joined: Fri Nov 24, 2017 8:45 am

Re: utf8 warning at installation step 4

Post by alfa24 »

Some Italian keys have been inserted in all other languages files for installer.
You can fix in /lib/installer/lang/english.php for English language.
Per supporto GRATUITO contattatemi in privato qui
tmasssfd
Newbie
Posts: 9
Joined: Mon Oct 05, 2015 9:29 pm
Version: forma.lms 1.4.1

Re: utf8 warning at installation step 4

Post by tmasssfd »

In case anyone has the same issue and does not know how to edit the code, here is a quick breakdown:

Replace the code in the file: /install/controllers/Step4Controller.php (starting at line 73)

if ($this->checkDBEmpty($db_name)) {
if ($this->checkDBCharset()) {
if ($this->checkStrictMode()) {
--$err;
array_push($res['ok'], 'db_host', 'db_name', 'db_user', 'db_pass', 'db_type');
} else {
array_push($res['err'], 'db_host');
array_push($res['ok'], 'db_name', 'db_user', 'db_pass', 'db_type');
$res['msg'] = Lang::t('_SQL_STRICT_MODE_WARN');
}
} else {
array_push($res['err'], 'db_name');
array_push($res['ok'], 'db_host', 'db_user', 'db_pass', 'db_type');
$res['msg'] = Lang::t('_DB_NOT_UTF8');
}
} else {
array_push($res['err'], 'db_name');
array_push($res['ok'], 'db_host', 'db_user', 'db_pass', 'db_type');
$res['msg'] = Lang::t('_DB_NOT_EMPTY');
}

with this code:

if ($this->checkDBEmpty($db_name)) {
if ($this->checkStrictMode()) {
--$err;
array_push($res['ok'], 'db_host', 'db_name', 'db_user', 'db_pass', 'db_type');
} else {
array_push($res['err'], 'db_host');
array_push($res['ok'], 'db_name', 'db_user', 'db_pass', 'db_type');
$res['msg'] = Lang::t('_SQL_STRICT_MODE_WARN');
}
} else {
array_push($res['err'], 'db_name');
array_push($res['ok'], 'db_host', 'db_user', 'db_pass', 'db_type');
$res['msg'] = Lang::t('_DB_NOT_EMPTY');
}

Hope this helps.
Post Reply