Installing moodle in Bluehost

Installing moodle in Bluehost

by Sanvidha Herath -
Number of replies: 33
Hi, 
I am trying to install moodle in Bluehost using "quick install" and "custom install". I am getting this error and not sure how to rectify the issue and install moodle successfully.

"

  The following errors were found :

  • Could not make the query numbered : 0
    MySQL Error No : 1253
    MySQL Error : COLLATION 'utf8_unicode_ci' is not valid for CHARACTER SET 'utf8mb4'
  • Could not make the query numbered : 6
    MySQL Error No : 1253
    MySQL Error : COLLATION 'utf8_unicode_ci' is not valid for CHARACTER SET 'utf8mb4'
"
I am new to Bluehost environment as well and asked help from them and they asked me to contact moodle in this regard. The version I am installing is 4.3.1. Please help.

Thanks
Sunny
Average of ratings: -
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
'using "quick install" and "custom install"' .... mind sharing the urls behind those?

Is server OS Linux?
Do you have cPanel or Plesk?
Does that panel have a Terminal icon?
Does that panel have a Git icon?
What hosting package did you lease?   Lowest/cheapest? (which also means less resources).

'SoS', Ken


In reply to Ken Task

Re: Installing moodle in Bluehost

by Sanvidha Herath -
Thanks for your reply.

I'm in the "choice plus" plan in the bluehost (https://www.bluehost.com).
Bluehost primarily uses Linux as the operating system for their servers, specifically CentOS, which is a popular and stable distribution of Linux.

I have cPanel.
There is a terminal icon in the panel.
It has Git Version Control
the package is one above the basic.

Hope this help to get a solution. I'll send more information if you need.

Thanks
Sunny
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
I also asked for URL's you used to attempt installing.
Please provide.

Now to gather some more info about server ...

CentOS ... click terminal, and at the prompt type:
uname -an [ENTER]

Copy and paste what you see there to a text file then come back here and share what it said.

Also:

BlueHost Choice Plus
40 Gig Space is ok.
I see they mention malware scanning ...

CentOS does use SeLinux which could cause problems with location of moodledata.
But you are reporting seeing issues with DB and character set!????

So one more command please:
df -h [ENTER]

and

php -v [ENTER]
Ditto on copy and paste info

Assuming your server had MySQL as DB engine:
mysql -V [ENTER]
Ditto on copy and paste info

'SoS', Ken

In reply to Ken Task

Re: Installing moodle in Bluehost

by Sanvidha Herath -
Thanks for your reply.

The URL for the installation : https://box5541.bluehost.com:2083/cpsess5346411912/frontend/jupiter/softaculous/index.live.php?act=software&soft=542

name -an
Linux box5541.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 x86_64 x86_64 GNU/Linux
ybeqtwmy@ybe.qtw.mybluehost.me [~]#

df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 22G 0 22G 0% /dev
/dev/sda1 74G 47G 24G 67% /opt
/dev/sda2 15G 36M 14G 1% /tmp
/dev/sda5 492G 130G 338G 28% /var
none 22G 5.0M 22G 1% /var/spool/exim
tmpfs 4.0G 8.0K 4.0G 1% /var/mysqltmp
tmpfs 4.0G 0 4.0G 0% /home
tmpfs 22G 2.2G 20G 11% /run/postgresql
/dev/sdb1 1.5T 932G 582G 62% /home1/ybeqtwmy
ybeqtwmy@ybe.qtw.mybluehost.me [~]#

php -v
PHP 8.2.13 (cli) (built: Dec 13 2023 17:16:36) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.13, Copyright (c) Zend Technologies
with Zend OPcache v8.2.13, Copyright (c), by Zend Technologies
ybeqtwmy@ybe.qtw.mybluehost.me [~]#

mysql -V :
mysql Ver 14.14 Distrib 5.7.23-23, for Linux (x86_64) using 6.2
ybeqtwmy@ybe.qtw.mybluehost.me [~]#

Please guide me through. Really appreciate your help.
Sunny
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
It appears that you have used some form of "auto-installer."  If so, don't.  Install Moodle from scratch.
 
This video of mine might help you get started.

See https://moodle.org/mod/forum/discuss.php?d=401983#p1621924
In reply to Rick Jerz

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
Have to ask ... did you correct your video when it came to character set and collation?

Error does say:
MySQL Error : COLLATION 'utf8_unicode_ci' is not valid for CHARACTER SET 'utf8mb4'

Which I translate as DB has utf8mb4 character set but has COLLATION 'utf8_blah ... which is not valid.

'SoS', Ken

In reply to Ken Task

Re: Installing moodle in Bluehost

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Hmmm, I am a little bit dizzy. The original post did mention this character set problem. I can't remember if this is the same OP as our other discussions. It seems to ring a bell.

As you know, I am far from an expert on collation and character sets, but I have seen information that says when you pick a collation, you "tend" to get the correct character set. I have recently proved this on several of my new installs. However, my own experience is limited. But it makes me wonder what is going on. In phpMyAdmin, I pick the Collation, and the character set follows.

Didn't we suggest to issue some SQL update commands? (Again, not sure if this is the same OP.)
In reply to Rick Jerz

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
Well something is amiss ..

Error does say:"
MySQL Error : COLLATION 'utf8_unicode_ci' is not valid for CHARACTER SET 'utf8mb4'

'SoS', Ken

In reply to Ken Task

Re: Installing moodle in Bluehost

by Sanvidha Herath -
Hi,

I checked the table collation using phpMyAdmin. All the tables except for one are "utf8mb4_unicode_ci"collation. The one that does not have this collation is "OPC_yoast_seo_links" which has "utf8_general-ci" and the sum for 61 table shows the collation is "uff_unicode_ci".

I accessed the structure of that table and changed "utf8_general-ci" to "utf8mb4_unicode_ci" at four sections (url, type, language and region) and then I saved it. But when I get back to see the entire tables, for this "OPC_yoast_seo_links" and the sum of all 61 tables, still show "utf8_general-ci" as the collation.

I kept the severer connection collation us "utf8mb4_unicode_ci" in phpMyAdmin general settings tab.

Still I get the same error. Please help.
Thanks
Sunny
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Maybe Ken has encountered that "...yoast..." table, perhaps some third-party plugin. It is not in the normal Moodle install.
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Sanvidha Herath -
I managed to change collation of all the tables (including sum) to "utf8mb4_unicode_ci" but still I can't install moodle as it gives the same error.

In phpMyAdmin the Server charset: UTF-8 Unicode (utf8). 

Hope you can help.

Sunny
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> I managed to change collation of all the tables (including sum) to "utf8mb4_unicode_ci" but still I can't install moodle as it gives the same error.

That is odd. If you are going to install Moodle then the existing tables do not matter. In fact, there shouldn't be any tables. Run 'drop database DBNAME; create database DBNAME;' before you start to wipe out any old data.

> In phpMyAdmin the Server charset: UTF-8 Unicode (utf8). 

The following is from a MariaDB database working perfectly in Moodle 4.1 LTS:

> use db999;
Database changed
MariaDB [db999]> select @@character_set_database, @@collation_database;
+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
| utf8mb4                  | utf8mb4_general_ci   |
+--------------------------+----------------------+
1 row in set (0.000 sec)
In reply to Visvanath Ratnaweera

Re: Installing moodle in Bluehost

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I followed your advice, Visvanath, and got the following (below). Now, this is interesting. What it shows is that my server collation defaults to "utf8mb4_0900_ai_ci." So, I checked my new installation of Moodle, and its collation is utf8mb4_unicode_ci. This is because after I created the database on my server, but before I installed Moodle, I went into phpMyAdmin and specifically set the collation to utf8mb4_unicode_ci.
 
The Moodle docs for mysql say collation should be utf8mb4_unicode_ci.
 
But Ken has been on to something.  It might be that one's server uses a different default character set and collation, so one should check and make sure to specifically set these using the ALTER command.  (Yep, Ken, I should revise my video.  I am traveling through Texas right now, so can't do it at the momemt.  Perhaps when I return from my trip.)


mysql> select @@character_set_database, @@collation_database;
+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
| utf8mb4 | utf8mb4_0900_ai_ci |
+--------------------------+----------------------+
1 row in set (0.00 sec)
In reply to Rick Jerz

Re: Installing moodle in Bluehost

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
The confusing thing about these parameters is that they can be set at table level, databases level or for the whole DBMS!

If the DBMS serves only Moodle and only recent ones, setting them one time for the whole DBMS will spare you some trouble.
In reply to Rick Jerz

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
Think the following speaks for itself:
'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Installing moodle in Bluehost

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Ah, interesting. Yep, now I see.

So, for Bluehost, perhaps their default is utf8?

The bottom line is that I need to revise my video a little and include something about checking and changing the character set.
In reply to Rick Jerz

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
@Rick ... probably a good idea as large/international hosting providers would probably leave mysql/mariadb to original defaults for most hosting situations.

Even if a BH account setup is correct for moodle, wouldn't hurt to check/run to assure compliance with what moodle wants.

'SoS', Ken
 
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
Guessing that 'OPC_yoast_seo_links' table is related to this:
which is a WordPress tool.

So - another guess ... there is a WordPress involved at OP's site.   WP's like to use .htaccess files at it's code root that have been known to have issues with moodles that are in directories inside of WP code.

Have been into multiple ops systems that have had issues with Moodle primarily due to WP.   Not that WP is bad software ... it's just the most popular and thus the most attacked.   If the moodle is in close enough proximity to WP, a WP not kept up to date and gets whacked could be the culprit for a whacked Moodle as well.

As usual ... my 2 cents!
'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Installing moodle in Bluehost

by Sanvidha Herath -
Can I manually install moodle by creating a database for it following Rick's video to keep the WP and moodle in the same server? will it have effects on the long run?

Can I install moodle first and then install WP later?

Thanks
Sunny
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
@Sanvidha Herath

They both can reside on the same server .. me thinks it's a matter of 'proximity' to one another.
Typically, WP would be the default site.  While you could have your WP interactive or even linked to the Moodle for certain purposes, WP's are 'informational' in nature - who we are, about us, staff, our services, our goals ... even descriptions of courses offered in the moodle with a link to sign up or the course itself. etc..

Moodle on the other hand is interactive.

Proximity .... used to be the standard location for the software that rules the roost for a web site was in /home/useraccount/public_html/ but could be in /var/www/html/.   If moodle were installed inside WP code it is seen by WP as part of WP and under control of WP's .htaccess.   Not good.

Below tld.x is a domain (tld = top level domain - like, for example, google.com.  A subdomain of that would be like maps.google.com

Depending upon how and where you host, your moodle could be called elearning.tld.x - a subdomain of the WP at tld.x.   And because it is a subdomain, elearning.tld.x has to be located else where on that server.  So elearning.tld.x could be in /home/useraccount/elearning.tld.x or /var/www/elearning.tld.x.

DNS points to same server and the config of your web service determines where traffic is directed when someone goes to elarning.tld.x.

elearning.tld.x now being away from the WP, it can have it's own restrictions when it comes to access and version of php it runs under (a possible use of .htaccess).   Moodle is more sensitive about versions of software that make it go ... ie, PHP + php extensions.

That clear as mud? :|

'SoS', Ken

In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Here is what you need to be careful of.

I like to install my Moodle in a folder, such as ../public_web/moodle4.
If I were to install WordPress, I would also put this in a folder, such as ../public_web/wordpress.

However, sometimes some people (or auto-helpers) want to put Wordpress at the top level, in ../public_web. You could really confuse your server if you then also tried to put Moodle at the same top lever, in ../public_web. You would never know which files and folders belong to which product, and it is possible that both product might use the same filenames. In my case, I use my website for many of my files outside of Moodle, so keeping Moodle in its own folder helps me manage my system.

So, I hope you understand the issue.

Incidentally, there are many ways that one can accomplish what you desire (Ken is providing some other ways,) and I am not an expert in all of the ways. I am just passing along my thoughts.  Remember, however, that your server has to be set up to accomodate the basic requirements of Moodle and WordPress, meaning that the database and php (typically) need to meet both products minimum, and general requirements.  I think at this point in time, both products are happy with MySQL 8.0 and PHP 8.0.  I would never trust any "auto-installer" to get it correct.
 
The Moodle docs for "Installation" describe what to do.  In my video, I try to follow these steps.  Use my video as a guide, or as additional background information.  There are many kinds of servers with different ways to install Moodle.
In reply to Rick Jerz

Re: Installing moodle in Bluehost

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
And the answer to the next question "Edwiser Bridge". (No link added, I think, it is commercial software. Don't know first hand.)
In reply to Ken Task

Re: Installing moodle in Bluehost

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Ken, here is the discussion that we had with another person about the same kind of issue. It was with ADENIRAN O. MICHAEL. It's odd for this "collation" and "character set" problem to occur with two different people.

Sanvidha, see if any of this other discussion is helpful, especially the SQL Alter command.  If this is your production Moodle, make sure to have backups in case something gets messed up.
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

https://moodle.org/mod/forum/discuss.php?d=453085#p1820757
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
Ok, am going to venture a guess ... in the instructions to install a moodle, one has to create a database for the moodle.  In cPanel there is a tool for that.   The database name will have a prefix to it ... like customerlogin_ then the name of the database you give that tool.
Write that down.
The other thing you need to do is use another cPanel tool to create a user for that database that has all prevlieges.  You also provide that user with a password.
Write those down as well cause when installing the moodle you will be prompted for that information.

Still though ... uname -an is significant info as RedHat and CentOS no longer have the same relationship they used to have and you really don't want to be using CentOS 7 as it's end of life is about a year away.

'SoS', Ken

In reply to Ken Task

Re: Installing moodle in Bluehost

by Sanvidha Herath -
Thanks for all of you for the support and advice.

Finally I learnt that Bluehost does not support MySQL 8 version in any of their plans.
Would you be able to recommend a good hosting service for moodle so that I can start building my course soon?

Thanks
Sunny
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
Huh?
https://www.bluehost.com/help/article/mysql-version
"The latest version of MySQL is 8.0.27, released on 19 October 2021."
Yet in their examples of finding version they show a response that
is clearly mariaDB 10.1.29 which is below min versions for running 3.9 of moodle and higher.
(10.2.29 or 10.4 or 10.6.7)

There are many hosting providers to choose from ....
Hostinger, A2 hosting, Dreamhost, Inmotionhosting, DigiatlOcen, Hostgator, GoDaddy,
IONOS, Linode, TMD,

Best for Moodle? is a toss!

Do READ:
https://docs.moodle.org/403/en/Finding_and_Selecting_A_Web_Host
https://docs.moodle.org/403/en/Decision_FAQ

Moodle Cloud?

Good luck!
'SoS', Ken

In reply to Ken Task

Re: Installing moodle in Bluehost

by Sanvidha Herath -
Thanks Ken.

I'll pick one of them.

Sunny
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Ken Task -
Picture of Particularly helpful Moodlers
Good luck in 'random' picking if that's what you mean! sad
In general, the cheapest/shared hosting setup doesn't have enough umph (memory/space) + very little control.   VPS's give options for memory/space and you have greater control but are responsible now for some 'heavy lifting' when it comes to server admin outside of moodle and are more expensive.

None of those that I listed are an official Moodle Partner ... thus help desk request would be limited to everything else but Moodle - they tend not to dive into customers applications.
WordPresses they do some ... but Moodle is a different beast.

For you, even if you don't think you'll use it, a couple of things to look for ... in the panel they provide, a Terminal.   That's command line access.   And even if you don't use it, a support person could.   Many do not provide attached data devices ... a disk just for storage.   Moodle's only grow if they are used and site backups + course backups taken at a regular interval could fill up the space for OS and Moodle application - thus the data disk.

Your best option right now might be Moodle's Cloud - unless you know that what you plan to do goes beyond the limitations of Moodle Cloud.

Good luck! smile
'SoS', Ken


In reply to Ken Task

Re: Installing moodle in Bluehost

by Sanvidha Herath -
Thanks for your reply.

I tried Moodle's Cloud but I can't install the plugin for "adaptive quiz" which I need in developing my course. If you have any advice, please let me know.

Cheers
Sunny
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
When you are picking a host, you really need to think about long term goals. If this is going to be a server with a lot of users and you want it to be solid, you would do much better to get a VPS now and install from scratch than throw a moodle server up on some shared hosting environment only to find out you need to rebuild and migrate the whole thing later. If you are just hosting a class or two for personal use, then you are probably fine with anything host that at least meets the requirements. Also, some hosts will migrate your site from shared hosting to a VPS for you so that might be something to look at when selecting.
Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Installing moodle in Bluehost

by Sanvidha Herath -
Thanks Emma.

I have a plan to grow it and I am thinking of getting the service from Moodle partners (https://moodle.com/solutions/certified-service-providers/?country=Australia) from the start.

Best regards,
Sunny
In reply to Sanvidha Herath

Re: Installing moodle in Bluehost

by Sanvidha Herath -
Hi Everyone.

I have looked at several VPS options. Due to the high cost in Australia for such a service, I am planning to get it from one of the Moodle certified partners in some other Asian country. They are happy to do the hosting and full management at a reasonable price. Please provide with me some advice on the pros and cons before I go ahead.

Cheers,
Sunny