Support > cpg1.5 miscellaneous
Coppermine 1.5.10 and PHP 8.1
shortmort37:
OK, I'm starting down the path of upgrading Coppermine so it will be compatible with PHP 8.1...
--- Quote from: ron4mac on May 17, 2023, 02:34:45 pm ---You should upgrade your 1.5.10 gallery to 1.5.48. Then you can use the installer stub to upgrade to 1.6.x. CPG 1.6.x will take care of all mysqli and PHP 8 issues with your gallery. Be aware that some plugins or themes may not be compatible with 1.6.x.
--- End quote ---
I followed the instructions - copied the source for 1.5.48, and invoked update.php - but, I'm getting this:
--- Quote ---Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/faulkner/public_html/59gallery/include/functions.inc.php:183 Stack trace: #0 /home/faulkner/public_html/59gallery/include/init.inc.php(171): cpg_db_connect() #1 /home/faulkner/public_html/59gallery/update.php(27): include_once('/home/faulkner/...') #2 {main} thrown in /home/faulkner/public_html/59gallery/include/functions.inc.php on line 183
--- End quote ---
What are my next steps?
shortmort37:
*BUMP*. Any advice for me?
On the assumption that mysqli was implicated (my bridged phpBB board is running PHP 7.4), I edited the 1.5.48 version of includes/functions.inc.php to include this, as I had with the 1.5.10 version:
--- Code: ---if (!function_exists('mysql_connect')) {
require 'mysql_mysqli.inc.php'; //* adjust to correct path based on where you placed the file...
}
--- End code ---
Still no love. Now I'm getting this error message:
--- Quote ---Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; CPGPlugin has a deprecated constructor in /home/faulkner/public_html/59gallery/include/plugin_api.inc.php on line 530
--- End quote ---
shortmort37:
Looking in the 1.5.48 version of include/plugin_api.inc.php at line 530, where the deprecated constructor was reported, I find this:
--- Code: --- function CPGPlugin($properties) {
--- End code ---
And I see that in the 1.5.10 version, I had to update this somewhere along the way to this:
--- Code: --- function __construct($properties) {
--- End code ---
So I did the same to the 1.5.48 version. And now, I get 500 errors.
I don't have the option of enabling an earlier version of PHP that 7.4, just to perform the upgrade. Short of enabling PHP error logging in Apache, do I have any recourse?
phill104:
Best bet is to use WAMP and do the work on your local machine. You can then test and work, changing PHP versions as required, to get your site fully tested and running. It is then a simple task to restore the now working site to your hosting.
shortmort37:
--- Quote from: phill104 on June 06, 2023, 08:17:41 pm ---Best bet is to use WAMP and do the work on your local machine. You can then test and work, changing PHP versions as required, to get your site fully tested and running. It is then a simple task to restore the now working site to your hosting.
--- End quote ---
Hmmm... One way, perhaps. But I don't currently have WAMP installed on my desktop (I have a server-side test env), and it seems like a lot of work to get there. And, how do I port the updated db to my db bridged to phpBB? Too many variables.
Instead, I've enabled PHP error logging on my site, and I've found the culprit - at least, the first culprit (and hopefully the last):
--- Quote ---Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in /home/faulkner/public_html/59gallery/update.php:33 Stack trace: #0 {main} thrown in /home/faulkner/public_html/59gallery/update.php on line 33
--- End quote ---
I see that set_magic_quotes_runtime has been deprecated in PHP 7.4, the earliest version I can use on my server. Can I safely comment out this line and proceed, or should I do something else?
Thanks
Dan
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version