PHP - minimum version allowed PHP - minimum version allowed
 

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]

Main Menu

PHP - minimum version allowed

Started by eLIANT, September 10, 2023, 04:57:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eLIANT

I'm seeing some PHP "Deprecated" messages.
I'm running CPG 1.6.16 and PHP 8.1

What action should I take?

ron4mac

When you log into your gallery as an admin do you not get a message that there are upgrades available? Since your CPG version is nine releases behind current (1.6.25), you should maybe think about upgrading it.

eLIANT

Surely I'm just missing it, but I don't see on the CPG site where it actually states the current version (although there is a button to "Download latest version cpg1.5.48.zip").  Nor in my installation is there anywhere to "Check for Updates."

eLIANT

I'm being directed to SourceForge for my downloads.  Is that correct?

eLIANT

One more thing...
the cookie used by coppermine-gallery.net should store a "last visited date" so when the visitor comes back and the Last Visited Date was BEFORE the current release date, the page does a forced refresh.  That's why my download button said cpg1.5.48.zip.  I just refreshed the page and now that button points to cpg1.6.x/releases.

eLIANT

Attempted to V6 (got a fatal error), and now Config says I'm at 1.6.16 but I'm still getting the "Deprecated" errors.
I'll post the fatal upgrade error in a separate thread.

eLIANT

Well, I logged out of everything, ran the update routine again...  success! 
But I'm still getting the "Deprecated" messages.

So we're back to the title question...  What is the minimum version of PHP allowed?  I need to downgrade my PHP to that version because CPG is making calls to procedures and functions in PHP 8.1 that are deprecated.

eLIANT

Downgraded PHP to 7.4...  no more "Deprecated" messages.  So, I've answered my own question;  CPG does not work with PHP 8.

ron4mac

Quote from: eLIANT on September 11, 2023, 03:40:33 AM
Downgraded PHP to 7.4...  no more "Deprecated" messages.  So, I've answered my own question;  CPG does not work with PHP 8.
The latest versions of CPG do indeed 'work' with PHP 8.  First of all, what version of CPG are you using?  If you are running the current latest version (1.6.25) of CPG, there should not any PHP messages causing failure. If that is what you are seeing with v1.6.25, please report the details. "It does not work" isn't very helpful.

406man

Are you running any plugins ?  If you are, one of these might be generating the message. Post the deprecated messages here as they will give a good pointer to the source of the error.

eLIANT

406man -- No plugins of my own.  Just whatever comes with the package.

ron4mac -- Now, I turned PHP 8 back on and took some screen shots...
Top image is of Home page right after logging in.
Second (larger) image is of User Manager.

All messages, and there are other screens beside these two, point to include/debugger.inc.php line 114.

ron4mac

#11
Quote from: eLIANT on September 11, 2023, 09:14:05 PM
ron4mac -- Now, I turned PHP 8 back on and took some screen shots...
Top image is of Home page right after logging in.
Second (larger) image is of User Manager.
Please don't waste people's time if you are not running a current version of CPG. You are not running the latest version (1.6.25, at the moment). When you login as admin, you will from time to time (weekly, I believe), be notified that there are updates to your CPG version. From there, it only takes a couple clicks to perform the update. Please update to the latest version.

406man

Trying to answer the original question about PHP supported versions....

Being very picky, you asked what is the minimum version of PHP supported. This would be PHP 7.0 with CPG 1.6.16   I think what you meant to ask is what is the highest / newest version of PHP supported without generating error messages about deprecated features.

If I've understood correctly, the feature described in the error message – conversion of false to array – was deprecated in PHP 8.1 according to the information here:
https://eusonlito.github.io/php-changes-cheatsheet/deprecated.html
So you need to go to the previous version line – 8.0.x

The Coppermine release notes here :
https://github.com/coppermine-gallery/cpg1.6.x/releases
... describe CPG 1.6.18 (two releases newer than yours) as being updated for use with PHP 8.1.x
...and CPG 1.6.16 as having improved compatibility with PHP 8

So I take from the above that the newest supported version with 1.6.16 is PHP 8.0.x   and any PHP 7 release will be safe from a compatibility perspective although not so good from a security and support perspective as it's getting old.
If you run a WAMP development environment it's easy to swap between different PHP versions and test compatibility although you might need to download a specific PHP version from the WAMP site that's not supplied with the WAMP distribution.