PHP7 / MySQLi / PDO support in Coppermine? - Page 2 PHP7 / MySQLi / PDO support in Coppermine? - Page 2
 

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

PHP7 / MySQLi / PDO support in Coppermine?

Started by Johnson.Wang, December 07, 2015, 12:05:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ron4mac

Quote from: BillR on December 10, 2016, 03:04:33 AM
Error
Releases of CPG not found at Github

Any easy way to fix that or have things moved somewhere else now?
It is still in place and works okay in my test. Your setup may not have allow_url_fopen enabled in your PHP and the extension libcurl is also not loaded. One of these is required for the upgrader to be able to access the 1.6.01 release on Github.

BillR

It's ok, It didn't take long to do it manually anyway - I dont use any modifications, so 1.6 works just fine. I guess tommorow I'll copy it into a php7 folder and see how that works.
  I can't thank you guys enough for all the work, coppermine has been my preferred gallery for as long as I can remember...10-12 years maybe?
- Bill

BillR

Just a last little comment, works great on php7, I'm a happy camper :)
Thanks again for the gallery work.

maxhasher

I managed to get 1.6 in upgraded and running. On first choice for login I made the mistake of selecting pdo:mysql and this added pdomysql in the onit as database option. This is not one of the paths. So I edited back yo mysqli and then everything was happy.
The cookie still registered as 1.5x though.. Excellent work there. But I should be OK with updating on the ISP. Which is recommending php7 for the longer term support.

Dale M.

New here and don't know squat about PHP... But got my gallery killed with  server updating to PHP 7..

It appears  as same error  as DAGGERS  posted on 1-27-16 and it appears there is a FIX in very next posting, but I don't know how to go about it (yes I am php ignorant) but is there a  simple set of step by step procedure  to get the fix to work?. I know its to copy "this" to "that"  in the "whatsit" file but its sort of greek as I am not php programmer or even familiar.. I know it has to be simple, but not for me?.... Thank to anyone who can walk me through it...

Dale M.

phill104

That fix was a temporary workaround. Best bet now is to upgrade to version 1.6.x, but you may run into a few problems if you were not up to date. Do a search on the forums regarding upgrading to 1.6 and you will find plenty of instruction. Here is one such thread - http://forum.coppermine-gallery.net/index.php/topic,79013.0.html
It is a mistake to think you can solve any major problems just with potatoes.

Dale M.

Been there done that, all I get is error when I try to run "upgrader.php"...

This is error, sort of puts me back to square 1...

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/maripos1/public_html/gallery/include/functions.inc.php:183 Stack trace: #0 /home/maripos1/public_html/gallery/include/init.inc.php(171): cpg_db_connect() #1 /home/maripos1/public_html/gallery/upgrader.php(21): require('/home/maripos1/...') #2 {main} thrown in /home/maripos1/public_html/gallery/include/functions.inc.php on line 183

So far "cpg_install_stub.php" and "upgrader.php" are no go.... And yes I did remove the "txt"  in file name and I did verify I was using proper URL to run file.. Just frustrated...

Dale

phill104

It is a mistake to think you can solve any major problems just with potatoes.

Dale M.

Quote from: Phill Luckhurst on July 15, 2017, 01:41:26 PM
What version of cpg were you running?

Version 1.5.42 according to change log in CPG root directory...

Dale



phill104

I will leave this in the other thread you have as this appears to be a duplicate of the same issue
It is a mistake to think you can solve any major problems just with potatoes.

donsenilo

Quote from: cheigu on December 25, 2015, 12:08:33 PM
For the mysql_connect support in PHP7, there is a library on http://sourceforge.net/projects/mysqlwithmysqli/ (usefull also for other projects and temporarly solutions)

cpg1.5.x has other problems with PHP7 and should not be used with it, altough the galery itself runs with the above mysql solution there are issues to solve in the admin section.
Hi

I had (!) to use PHP7.
I've downloaded the library but what now ? How can I use it ?

gmc

As stated in the post you quoted - it won't fix all the errors under PHP7.. Likely best to upgrade to CPG 1.6.

But to use the file you downloaded - you would need to place it in the CPG directory on your server - I would suggest in yourcpgfolder/include directory...
Then open yourcpgfolder/include/init.inc.php and find:
require 'include/functions.inc.php';
and insert before it:
require 'include/mysql_mysqli.inc.php';
(substitute the file name you saved/uploaded as if different...)

When a mysql_ function is called - it will be defined by this addition - and will call the equivalent (assuming the library is coded correctly - I haven't used or tested it) mysqli function for you and return the result.

Again - there will be other issues with CPG 1.5 and PHP7... These are all resolved in CPG 1.6.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money