forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: luchtzak on January 10, 2017, 08:12:11 pm

Title: PHP 7.0
Post by: luchtzak on January 10, 2017, 08:12:11 pm
Got my server upgraded to 7.0 yet coppermine is INOP now.

Any solution ?
Title: Re: PHP 7.0
Post by: phill104 on January 10, 2017, 09:26:17 pm
Coppermine 1.5.x does not support PHP7. There is available version 1.6.x which is still in beta and does support PHP 7.
Title: Re: PHP 7.0
Post by: ron4mac on January 11, 2017, 12:56:28 am
Any solution ?

If what you were running was a fairly recent version of CPG1.5.x (say at least version 1.5.38), you should be able to upgrade your installation following these directions: http://forum.coppermine-gallery.net/index.php/topic,78505.msg381584.html#msg381584
[edit: that won't work because you can't log in .. duh]
You'll have to do a manual install of v1.6.01: https://github.com/coppermine-gallery/cpg1.6.x/releases
Title: Re: PHP 7.0
Post by: phill104 on January 11, 2017, 01:50:10 pm
Many hosts also allow the possibility to continue running an older version of PHP for specific URLs via either an .htaccess, via the cpanel or via the php.ini. It might be worth speaking to your host if you want to use the upgrade method mentioned above.
Title: Re: PHP 7.0
Post by: maxhasher on January 12, 2017, 01:53:21 pm
I know 1 and 1 will allow you to use older versions of php5 but will add a maintenance fee for doing so.
I have got the 1.6 working on my local box.
Do you think it is more sense just downloading the production gallery tables and albums, converting the tables and then  uploading the code and  tables to replace the existing ones but with the prod passwords in place?

p.s. would you want any test support? I used to be employed as an IT tester.
Title: Re: PHP 7.0
Post by: ron4mac on January 12, 2017, 02:05:53 pm
It makes the most sense to just upgrade your site in the standard way (http://documentation.coppermine-gallery.net/en/upgrading.htm#upgrade_any) with a fresh copy of CPG 1.6.
Title: Re: PHP 7.0
Post by: phill104 on January 12, 2017, 03:32:51 pm
p.s. would you want any test support? I used to be employed as an IT tester.

We always appreciate any contributions from the community. The whole project is community based, the admin team here do it as a hobby. As you know, much of the code, themes, language packs, documentation etc has been contributed by the users. We would love to grow the team and see more people developing as that would really speed things up.
Title: Re: PHP 7.0
Post by: luchtzak on January 15, 2017, 10:59:12 pm
I have the following error code, do I need to change something in the config.php file ?

Code: [Select]
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/luchtzak/domains/luchtzak.be/public_html/pictures/include/database/mysql/dbase.inc.php:29 Stack trace: #0 /home/luchtzak/domains/luchtzak.be/public_html/pictures/include/init.inc.php(173): CPG_Dbase->__construct(Array) #1 /home/luchtzak/domains/luchtzak.be/public_html/pictures/index.php(25): require('/home/luchtzak/...') #2 {main} thrown in /home/luchtzak/domains/luchtzak.be/public_html/pictures/include/database/mysql/dbase.inc.php on line 29
Title: Re: PHP 7.0
Post by: gmc on January 16, 2017, 02:25:01 am
Deleted...
Title: Re: PHP 7.0
Post by: ron4mac on January 16, 2017, 04:25:03 am
I have the following error code, do I need to change something in the config.php file ?

It looks like you are running CGP 1.6 that was configured to access the db via the mysql interface but must have switched to PHP 7 ... where mysql does not work.

In the file include/config.inc.php, change the database type to mysqli.

Code: [Select]
$CONFIG['dbtype'] = 'mysqli'; // Your database type
Title: Re: Re: PHP 7.0
Post by: luchtzak on January 16, 2017, 10:21:56 am
It looks like you are running CGP 1.6 that was configured to access the db via the mysql interface but must have switched to PHP 7 ... where mysql does not work.

In the file include/config.inc.php, change the database type to mysqli.

Code: [Select]
$CONFIG['dbtype'] = 'mysqli'; // Your database type

Thanks!

www.luchtzak.be/pictures
Title: Re: PHP 7.0
Post by: maxhasher on March 07, 2017, 06:31:21 pm
Quite interesting issue on my development machine
It may affect other users on update if they have been running for a while and have custom themes.
The one I had was based on a 1.5.30 template which currently works on the production site but on the development machine with PHP 7.0.15 it stops the thumbnails working in the display website as the theme.php still contained mysql_num_rows code
This is not a problem if you are logged in to admin as that check was not made.
This may need highlighting to others updating to php7
Title: Re: PHP 7.0
Post by: phill104 on March 07, 2017, 06:50:35 pm
Thanks. A lot of work still needs to be done before stable release. Theme and plugin updates are going to be a chore as well as documentation. Which theme are you using?
Title: Re: PHP 7.0
Post by: maxhasher on March 07, 2017, 07:36:25 pm
It was a modified version of curve I think. but 1.5.30
 i just copied everything new in 1.6 Curve except the template.html over to the custom theme and it seems ok.
I will try to make it prettier one day.

1.6 is working pretty well in ubuntu . I have selected the mysqli option as the first time i tried the pdo selection on logging it it gave me some issue. (sorry I cant recall at present. I will try re-installing soon over another backup and use PDO to check)
 I am trying to  see if I can work out how to get it to operate with the login via www.cheshirehash.co.uk in place of logging in again to cpg.
Though I could just set up two users in cpg and do something that way.
Good job so far
Keep it up

 aside from the above I had one or two issues in my code due to the mysql version being 5.0.12 . It defaults to strict mode and doesn't like, for example,  0000-00-00 as default dates. I had to rewrite to NULL. and also go tighter using the ORDER by option in queries
I dont think 1and 1 will be updating soon on mysql version but the fixes to strict model are all backward compatible
Title: Re: PHP 7.0
Post by: maxhasher on March 27, 2017, 03:05:39 pm
On Version Check on the cpg1.6.01
I get the following mandatory file missing for xp_publish.php
It doesn't appear in the distribution on github.
Is it critical?
I also get
js/swfupload/    mandatory        n/a       Mandatory file is missing    
jsjs/swfupload/fileprogress.js    mandatory        n/a       Mandatory file is missing    
jsjs/swfupload/handlers.js    mandatory        n/a       Mandatory file is missing    
jsjs/swfupload/swfupload.js    mandatory        n/a       Mandatory file is missing    
swfjs/swfupload/swfupload.swf    mandatory        n/a       Mandatory file is missing    
jsjs/swfupload/swfupload.queue.js    mandatory        n/a       Mandatory file is missing    
jsjs/swfupload/swfupload.swfobject.js    mandatory     
is this still WIP?
Title: Re: PHP 7.0
Post by: ron4mac on March 27, 2017, 06:02:15 pm
On Version Check on the cpg1.6.01
I get the following mandatory file missing for xp_publish.php
is this still WIP?

You can ignore those.  As you determined, they are no longer a part of the distribution. Thanks much for the feedback ... I'll clean that up.

Though stable, yes, it is still somewhat a Work In Progress (with no workers :-\).
Title: Re: PHP 7.0
Post by: phill104 on March 27, 2017, 06:44:43 pm
Sadly Andre is very tied up at the moment. I think I may begin to open up the 1.6 forums for contributors to start getting things in motion.
Title: Re: PHP 7.0
Post by: ron4mac on March 27, 2017, 06:49:39 pm
Sadly Andre is very tied up at the moment. I think I may begin to open up the 1.6 forums for contributors to start getting things in motion.
Great idea!
Title: Re: PHP 7.0
Post by: maxhasher on March 27, 2017, 06:49:53 pm
I have been going through the odd 1.5.54 markers and changing the headers to reflect 1.6.01 and eliminating the old uri to sourceforge. There were only a few.
It all looks fairly tight on behaviour IMO.
After looking at the dev route code I see that the js stuff has been relocated to elsewhere.
I'll keep thrashing around seeing what I can break. ;-)

Title: Re: PHP 7.0
Post by: maxhasher on March 29, 2017, 06:50:57 pm
I've pulled up an error
(Critical error  There was an error while processing a database query)
 in upload with 1.6.01 with basic details in the attached txt file.
No issue with the cpg Admin user but failure as a Registered user.
Not sure if it is caused by datetime ( as i had an issue of putting 0000-00-00 in a date field in my own tables as deprecated and also if there is an ordering issue that needs specifying for example Order by min(date)
I cant identify exactly at the moment but suspect mySQL 5.7 and strict as no issue on production server
Title: Re: PHP 7.0
Post by: maxhasher on March 29, 2017, 07:34:32 pm
Further to last :-
As I was on my local machine I followed some advice and added
disable_strict_mode.cnf
containing
[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

to the /etc/mysql/conf.d/ folder

this allowed the registered user to upload.
I can't work out where the difference is between the admin and the registered user SQL settings in UPLOAD.PHP that would bar the reg user and not the admin by strict mode.
I would have thought it would be both or neither.
Title: Re: PHP 7.0
Post by: ron4mac on March 30, 2017, 01:31:56 am
I've pulled up an error
(Critical error  There was an error while processing a database query)
 in upload with 1.6.01 with basic details in the attached txt file.
No issue with the cpg Admin user but failure as a Registered user.

Thank you very much for providing good feedback. I created a fresh system (Linux) with PHP 7.0.15 and mysql 5.7.17.  I was able to see the problem that you described and was able to make coding corrections to prevent the error. The error stemmed from strict usage requirements of the sql DISTINCT keyword.

I have applied the corrections to the Github distribution.
Title: Re: PHP 7.0
Post by: maxhasher on March 30, 2017, 02:11:46 pm
Glad to help
Don't think it will be long before 1&1 update php to 5.7 but not sure where they will go with the mysql server. But better to engineer than to repair..
Title: Re: PHP 7.0
Post by: maxhasher on March 31, 2017, 04:53:48 pm
tested ok having just overwritten the january code with the march version.
Good going.
Long way down the code that.
I had a similar issue with not adding a field I was querying with.
Title: Re: PHP 7.0
Post by: maxhasher on March 31, 2017, 07:10:22 pm
Hi ron4mac Got another
In the new version of the code
On the home page it displays a link to the user galleries
Clicking this pulls up the page index.php?cat=1
and produces
Critical error
There was an error while processing a database query
Title: Re: PHP 7.0
Post by: ron4mac on March 31, 2017, 08:16:13 pm
Okay ... thanks.

Fix is:
file bridge/udb_base.inc.php replace line 521
Code: [Select]
. "WHERE ((ISNULL(approved) OR approved='YES') AND category > " . FIRST_USER_CAT . ") $FORBIDDEN_SET GROUP BY user_id "
with
Code: [Select]
. "WHERE ((ISNULL(approved) OR approved='YES') AND category > " . FIRST_USER_CAT . ") $FORBIDDEN_SET GROUP BY category, user_id "

Max, it would be better if you could create 'issues' at the CPG 1.6 Github repository for any additional items that you may run across in your particular system setup.
Title: Re: PHP 7.0
Post by: maxhasher on March 31, 2017, 08:20:15 pm
ok thanks.

I'll do that then on git
Title: Re: PHP 7.0
Post by: maxhasher on March 31, 2017, 08:24:12 pm
works well..
Sorry, my testing background has kicked in  ;D
Title: Re: PHP 7.0
Post by: ron4mac on March 31, 2017, 09:54:39 pm
Sorry, my testing background has kicked in  ;D

No sorry here ... your help is truly appreciated.
Title: Re: PHP 7.0
Post by: luchtzak on June 22, 2017, 12:21:13 am
http://www.luchtzak.be/pictures/
Title: Re: PHP 7.0
Post by: ron4mac on June 22, 2017, 01:43:51 am
http://www.luchtzak.be/pictures/

Use this to update to 1.6.03:
http://forum.coppermine-gallery.net/index.php/topic,79013.0.html
Title: Re: Re: PHP 7.0
Post by: luchtzak on June 22, 2017, 08:44:32 am
Use this to update to 1.6.03:
http://forum.coppermine-gallery.net/index.php/topic,79013.0.html

Doesn't work ...
Title: Re: PHP 7.0
Post by: phill104 on June 22, 2017, 11:47:51 am
In what way "doesn't work"? A bit more information telling us exactly the problem might help us help you.
Title: Re: Re: PHP 7.0
Post by: luchtzak on June 22, 2017, 11:48:17 am
In what way "doesn't work"? A bit more information telling us exactly the problem might help us help you.

Works again! The database crashed...