XF 2.1 Problems with site after upgrading PHP

Fatal error: Uncaught exception 'XF\Db\Exception' with message 'The server requested authentication method unknown to the client' in /home3/soxhaps/public_html/src/XF/Db/Mysqli/Adapter.php:165 Stack trace: #0 /home3/soxhaps/public_html/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array) #1 /home3/soxhaps/public_html/src/XF/Db/AbstractAdapter.php(60): XF\Db\Mysqli\Adapter->getConnection() #2 /home3/soxhaps/public_html/src/XF/Db/Mysqli/Adapter.php(113): XF\Db\AbstractAdapter->connect() #3 /home3/soxhaps/public_html/src/XF/Db/AbstractAdapter.php(516): XF\Db\Mysqli\Adapter->escapeString('options') #4 /home3/soxhaps/public_html/src/XF/Db/AbstractAdapter.php(494): XF\Db\AbstractAdapter->quote('options') #5 /home3/soxhaps/public_html/src/XF/DataRegistry.php(138): XF\Db\AbstractAdapter->quote(Array) #6 /home3/soxhaps/public_html/src/XF/DataRegistry.php(83): XF\DataRegistry->readFromDb(Array, Array) #7 /home3/soxhaps/public_html/src/XF/DataRegistry.php(226): XF\DataRegistry->get('options') #8 /home3/soxha in /home3/soxhaps/public_html/src/XF/Db/Mysqli/Adapter.php on line 165
I’m getting the following error on my site after attempting to upgrade php from 5.6 to 7.4.

Hostgator support cannot seem to figure out the issue. I was wondering if any of you had a similar problem and could help me help them fix it.
 
The script says we meet all requirements. Hostgator have tried all sorts of versions of PHP, and we get the same result as well. Initially I believed it was because the Mysqli extension was not configured properly, but now I"m completely lost as to why this isn't working.
 

Brogan

XenForo moderator
Staff member
It does appear to be an issue with the mysql, based on this line from the error trace:
Code:
 The server requested authentication method unknown to the client' in /home3/soxhaps/public_html/src/XF/Db/Mysqli/Adapter.php:165 Stack trace: #0 /home3/soxhaps/public_html/src/XF/Db/Mysqli/Adapter.php(28):

Which version of MySQL is running?

Based on some stackoverflow comments, you may need to edit my.cnf and add an entry to the mysqld section.
 
5.6.

We're on a shared hosting, so I'm not sure I'll have privileges to make that edit. I also have no idea where to find the my.cnf file. Searching through the WHM file manager comes up with no hits.
 

Brogan

XenForo moderator
Staff member
If you're on shared hosting, your host will most likely have to make the change.

Out of the box though, upgrading/switching PHP versions shouldn't affect MySQL - it should be possible to switch between versions and just restart Apache, so there may be something else going on, such as an incorrectly configured php.ini file.
 
php.ini seems ok, unless I'm missing something obvious:

; cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)

allow_url_fopen = On
allow_url_include = Off
display_errors = On
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 256M
post_max_size = 260M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php74"
upload_max_filesize = 256M
zlib.output_compression = Off
extension = mysqli
 
Top