I tried to install Magento 2.4.6-p4 that supports MariaDB 10.6 but the installed version of MariaDB is 10.11.6. I changed the di.xml but now I get this message:
Warning: preg_match(): Compilation failed: range out of order in character
class at offset 25 in public_html/vendor/magento/framework/DB/
Adapter/SqlVersionProvider.php on line 101
I am afraid to face more issues and it may be a good idea to just downgrade MariaDB. How can I do that?
Here is the function on line 101:
preg_match($pattern, $sqlVersionOutput, $match);
if (empty($match)) {
throw new ConnectionException(
sprintf(
“Current version of RDBMS is not supported. Used Version: %s. Supported versions: %s”,
$sqlVersionOutput,
implode(', ', array_keys($this->supportedVersionPatterns))
)
);
}
Do not do it! Downgrading your database server to accommodate software’s artificial tests is something that should never be done on a production system.
By the way, Magento installation works just fine on Debian 12 with MariaDB 10.11, as we are already patching di.xml file, though it needs to be done right. It’s tricky.
After the Magento installation by Virtualmin is complete, if you check di.xml, you’ll see how we handle it. Here’s an example:
Please avoid recommending extreme solutions; some users might take them seriously – even worse, some users might do it without making any backups first!
While I agree one shouldn’t downgrade a database lightly, I also question whether we can actually say with confidence it is an artificial test? The Magento devs surely know more about their database compatibility than we do? It seems dangerous to override their checks to imply compatibility where that isn’t assured. I don’t think we should be messing around in their business…if the test is wrong, report it upstream, don’t patch it in our software.
This is optional in the Magento installation script; removing it would make Magento non-installable on many operating systems our users use, eventually leading to (and has actually led to) blaming us.