Upgrading from PHP 7.3 to 8.2 Fatal Error: Uncaught Error Upgrading from PHP 7.3 to 8.2 Fatal Error: Uncaught Error
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Upgrading from PHP 7.3 to 8.2 Fatal Error: Uncaught Error

Started by 911Patches, January 01, 2026, 10:55:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

911Patches

Hello

I updated my PHP one step at a time from 7.3 to 7.4 to 8.0 to 8.1
I eventually want to end up at 8.2 for site host performance issues etc.
However, sometime when I went to 8.1 I was getting this error when using index.php

Fatal error: Uncaught Error: Call to undefined function mysqli_report() in /home/patchgallery/public_html/include/database/mysqli/dbase.inc.php:32 Stack trace: #0 /home/patchgallery/public_html/include/init.inc.php(172): CPG_Dbase->__construct() #1 /home/patchgallery/public_html/index.php(22): require('/home/patchgall...') #2 {main} thrown in /home/patchgallery/public_html/include/database/mysqli/dbase.inc.php on line 32

I have degraded back to 7.4 but am still getting this fatal error.

Any ideas on what I can do so that I can update PHP?

Thank You

911Patches

This was also an error:

Fatal error: Uncaught ArgumentCountError: strtolower() expects exactly 1 argument, 2 given in /home/patchgallery/public_html/plugins/theme_switch/codebase.php:53 Stack trace: #0 /home/patchgallery/public_html/plugins/theme_switch/codebase.php(53): strtolower() #1 /home/patchgallery/public_html/include/plugin_api.inc.php(307): theme_switch_page_start() #2 /home/patchgallery/public_html/include/init.inc.php(442): CPGPluginAPI::action() #3 /home/patchgallery/public_html/index.php(22): require('/home/patchgall...') #4 {main} thrown in /home/patchgallery/public_html/plugins/theme_switch/codebase.php on line 53

406man

The most likely cause of the first error is that the particular version of PHP you are using has not been configured to include the mysqli module.

You can prove it by creating this tiny PHP file and putting it in your top level CPG directory and running it from a web browser:
<?php
// Show the PHP configuration
    
phpinfo();
?>

It will list the PHP configuration including all the modules in alphabetical order including their settings. If you have mysqli it will appear between mbstring and mysqlnd – assuming those modules are included in the PHP configuration. Remember to delete it or move to another directory afterwards.

If you have access to the PHP.ini file for the web server find the line

; extension=mysqli

and uncomment it by removing the ; character and restart the web server.

If you don't have access to it you'll have to ask your web host support team.

The error described in your second message  comes from the theme_switch plugin which I presume is not compatible with PHP 8. Version 1.1 of the plugin is here:

https://coppermine-gallery.com/forum/index.php/topic,79377.0.html

...and a post elsewhere on the forum says it is PHP 8 compatible although I've not tried it myself to be able to confirm.

911Patches

Thank You!
I am having my webhost (godaddy) edit that file.
It now seems to be working fine on PHP 8.1 but when I change it to 8.2 I get the same error.
After they edit that file, will I be able to get to 8.2-3-or-4?

406man

Whether the PHP version will work properly or not depends on the version of CPG you're running and which, if any, additional plugins beyond those supplied with the CPG distribution you are using.

If you have CPG 1.6.27 you can run PHP 8.4. Some older plugins will be incompatible with 8.4.  Best option is to go up in steps and go back if you run into problems. As a principle, in my galleries, I don't run on the leading edge of PHP versions.

911Patches

Thank You 406man, this is fixed and is working.
Appreciate the help!