Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Coppermine 1.5.10 and PHP 8.1  (Read 657 times)

0 Members and 2 Guests are viewing this topic.

shortmort37

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 87
Coppermine 1.5.10 and PHP 8.1
« on: May 15, 2023, 06:47:26 pm »

I have Coppermine bridged to phpBB, which I've recently upgraded to 3.3.10 because it was using PHP 7.4, which is going to be deprecated.  I'm able to switch to PHP 8.1, but that breaks coppermine.

I had this experience once before, related to mysqli; the solution was to modify includes/functions.inc.php to include this code:

Code: [Select]
if (!function_exists('mysql_connect')) {
    require 'mysql_mysqli.inc.php';         //* adjust to correct path based on where you placed the file...
}

I also added the file mysql_mysqli.inc.php to the includes path, and that fixed the issue.  That time.

Is there a similar, easy fix to be able to use PHP 8.1 - or, do I need to do a wholesale upgrade of coppermine to 1.6.x?

Thanks
Dan
Logged

shortmort37

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 87
Re: Coppermine 1.5.10 and PHP 8.1
« Reply #1 on: May 16, 2023, 03:08:02 am »

For what it's worth, my webserver reports a 500 Error when going to Coppermine via the bridge, after I've swapped PHP 8.1 in for PHP 7.4.

Dan
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1537
  • aka 'i-imagine'
    • Home Page
Re: Coppermine 1.5.10 and PHP 8.1
« Reply #2 on: May 16, 2023, 06:16:40 pm »

Is there a similar, easy fix to be able to use PHP 8.1 - or, do I need to do a wholesale upgrade of coppermine to 1.6.x?
You'll need to upgrade. Review the docs before starting.

For what it's worth, my webserver reports a 500 Error when going to Coppermine via the bridge, after I've swapped PHP 8.1 in for PHP 7.4.

Dan
Could be caused by Coppermine itself, your theme or an incompatible plugin as examples.

shortmort37

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 87
Re: Coppermine 1.5.10 and PHP 8.1
« Reply #3 on: May 17, 2023, 04:39:16 am »

You'll need to upgrade. Review the docs before starting.

OK, I will give that a shot.  I'll upgrade keeping PHP 7.4, and if that's successful attempt to switch to PHP 8.1.  I'll report my findings back here.

Do you know if the mysqli remediation I refer to at the beginning of this thread is addressed by 1.6.x - or, will I need to reapply it?

Dan
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 1988
Re: Coppermine 1.5.10 and PHP 8.1
« Reply #4 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. 
Logged

shortmort37

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 87
Re: Coppermine 1.5.10 and PHP 8.1
« Reply #5 on: May 17, 2023, 09:43:38 pm »

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.

This is such good news - thanks!

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.

Is that because there will be issues if I do a single-shot upgrade to 1.6.x?  Someone commented that the installer stub script was just to make it easier for some people - but, how is a two stage process easier?

Thanks
Dan
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 1988
Re: Coppermine 1.5.10 and PHP 8.1
« Reply #6 on: May 17, 2023, 10:05:36 pm »

There are some changes that were made (some involving the db) between 1.5.10 and 1.5.48 that will need to be applied to your gallery before upgrading to 1.6.x.  If you had kept your gallery up to date it would have been a simple one shot upgrade that the installer stub does in a matter of seconds. With 1.6.x, future updates are done with a few simple clicks.
« Last Edit: May 18, 2023, 03:19:27 am by ron4mac »
Logged

shortmort37

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 87
Re: Coppermine 1.5.10 and PHP 8.1
« Reply #7 on: May 18, 2023, 04:15:49 am »

Fair enough.  Thank you!

Dan
Logged

shortmort37

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 87
Re: Coppermine 1.5.10 and PHP 8.1
« Reply #8 on: May 18, 2023, 04:25:45 am »

Oh, one last question:  I don't have any plugins, but I do have a bridge from phpBB.  Can I expect that it will continue to work after the upgrade?

Dan
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4871
    • Windsurf.me
Re: Coppermine 1.5.10 and PHP 8.1
« Reply #9 on: May 19, 2023, 10:16:38 pm »

Yes, but you might have to look at your plugins before you upgrade to make sure there are compatible versions available
Logged
It is a mistake to think you can solve any major problems just with potatoes.

shortmort37

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 87
Re: Coppermine 1.5.10 and PHP 8.1
« Reply #10 on: June 04, 2023, 09:43:31 pm »

OK, I'm starting down the path of upgrading Coppermine so it will be compatible with PHP 8.1...

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.

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

What are my next steps?
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 22 queries.