Joomla error Application Instantiation Error: Could not connect to MySQL

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
abhinavaggarwal
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Nov 28, 2021 10:06 am

Joomla error Application Instantiation Error: Could not connect to MySQL

Post by abhinavaggarwal » Mon Nov 29, 2021 8:51 am

I am running my site on Centos6. The database is installed on a separate server, and the site is working fine.

I plan to shift the Joomla site on fresh installation on Oracle Linux 8, as CentOS6 reached the end of life. I replicated all the configurations and moved the site folder to the new server.

I can connect the database from the new server. But when I try to open the page, I get the error "Application Instantiation Error: Could not connect to MySQL".

The old server is still up and running, and there is no issue in the old server, but with the installation done on the Oracle Linux 8 server, I am getting the above problem.

I installed a fresh Joomla instance to check whether any dependency was missed, and it worked perfectly with the same database server.

I diagnosed further that the previous server was running with the following PHP version

PHP 5.6.40 (cli) (built: Jan 12 2019 09:19:57) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

The new server is running on the following PHP version:

PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.24, Copyright (c) 1999-2018, by Zend Technologies

What may be the issue and how to debug, so I may move the server to the latest server version?

Thanks a ton in advance.

Regards

Abhinav Aggarwal

gws
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4521
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Joomla error Application Instantiation Error: Could not connect to MySQL

Post by gws » Mon Nov 29, 2021 8:57 am

Possibly your old server is using mysql as the db connector and the new server is using php 7.2.4 and that probably needs the mysqli connector? Check in your global config file in joomla.

User avatar
AMurray
Joomla! Champion
Joomla! Champion
Posts: 7393
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Joomla error Application Instantiation Error: Could not connect to MySQL

Post by AMurray » Mon Nov 29, 2021 9:26 am

I wouldn't be using an outdated PHP 7.2 either.

I'd recommend PHP 7.4 or 8.0.

PHP 7.2 is was EOL in December 2020, PHP 7.3 will be EOL December 2021.
https://www.php.net/supported-versions.php
Regards - A Murray

abhinavaggarwal
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Nov 28, 2021 10:06 am

Re: Joomla error Application Instantiation Error: Could not connect to MySQL

Post by abhinavaggarwal » Wed Dec 01, 2021 2:40 pm

I updated the PHP from 7.2 to 8.0
The error shown earlier regarding the database connection is gone, but I am now getting error 500.
Trying to diagnose, but not able to find the reasons for the same.
I set the apache log to debug level.
When I am trying to open the page it is showing one error as
AH00894: declining URL fcgi://localhost/var/www/html/index.php

It seems I have done something wrong while setting up the Apache server.
Please help in determining the issue that I did wrong while setting up the Apache server.


Post Reply

Return to “General Questions/New to Joomla! 3.x”