Announcement

#1 2016-08-28 16:29:57

sorhol
Member
2013-07-27
25

Move to new server with Ubuntu 16.04

Hi,
I am just about to upgrade my hardware and therefore have to move a few Piwigo sites to the new server.
However I would like to update to Ubuntu 16.04 and this comes default with php 7.0
I tried to backup/restore db and copy all Piwigo files. The sites comes up, but I keep getting errors like:
---
Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean in /var/www/jaguarbar/include/dblayer/functions_mysqli.inc.php:893 Stack trace: #0 /var/www/jaguarbar/include/section_init.inc.php(318): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /var/www/jaguarbar/index.php(27): include('/var/www/jaguar...') #2 {main} thrown in /var/www/jaguarbar/include/dblayer/functions_mysqli.inc.php on line 893
---

I assume this is related to php 7,0.
How would recommend me to do this?
Perhaps I can just rung php 5.5 on the Ubuntu 16.04 - or you have a better solution?

Thanks in advance,
/Soren Holte


Piwigo version: 2.8.2
PHP: 5.5.9-1ubuntu4.19 (Vis info) [2016-08-28 16:23:40]
MySQL: 5.5.50-0ubuntu0.14.04.1 [2016-08-28 16:23:40]
Piwigo URL: http://jaguarbar.dk

Offline

 

#2 2016-08-28 22:13:39

Zentalquabula
Member
2014-05-10
217

Re: Move to new server with Ubuntu 16.04

In local/config/database.inc.php make sure you have selected mysqli:

Code:

$conf['dblayer'] = 'mysqli';

PHP 7 is not compatible with the old mysql driver.

Also make sure you have actually installed php7.0-mysql (sudo apt install php7.0-mysql).

My piwigo works as a charm on Xenial.

Last edited by Zentalquabula (2016-08-28 22:14:21)

Offline

 

#3 2016-08-29 05:39:39

sorhol
Member
2013-07-27
25

Re: Move to new server with Ubuntu 16.04

Thanks!
I will try this.

Offline

 

#4 2016-09-01 08:39:28

sorhol
Member
2013-07-27
25

Re: Move to new server with Ubuntu 16.04

Nope, that did not help.
I have php7 installed and I have $conf['dblayer'] = 'mysqli';
The site loads fine and I get the album overview fine, but I get the error below when openeing an album.
Note there is also a couple of warnings of irregular SQL before the fatal error;
I hope someone can help as I would like to use Ubuntu 16.04 with Php7.
TIA

Error:

Warning:  [mysql error 3065] Expression #1 of ORDER BY clause is not in SELECT list, references column 'jaguarbar.piwigo_images.date_creation' which is not in SELECT list; this is incompatible with DISTINCT

SELECT DISTINCT(image_id)
  FROM piwigo_image_category
    INNER JOIN piwigo_images ON id = image_id
  WHERE
    category_id = 7
AND (category_id NOT IN (8))
  ORDER BY date_creation ASC, file ASC, id ASC
; in /var/www/jaguarbar/include/dblayer/functions_mysqli.inc.php on line 832


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on boolean in /var/www/jaguarbar/include/dblayer/functions_mysqli.inc.php:893 Stack trace: #0 /var/www/jaguarbar/include/section_init.inc.php(318): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /var/www/jaguarbar/index.php(27): include('/var/www/jaguar...') #2 {main} thrown in /var/www/jaguarbar/include/dblayer/functions_mysqli.inc.php on line 893

Offline

 

#5 2016-09-01 09:17:03

sorhol
Member
2013-07-27
25

Re: Move to new server with Ubuntu 16.04

Hi Zentalquabula
I found an earlier post where you pointed out that strict mode had to be disabled.
I did this and now everything works.
Thank you so much!

However I am a little concerned about this. I am afraid that if I keep running my sites using Php7 and Mysql 5.7  this could cause problems for me - eg in a future update.

Offline

 

#6 2016-09-01 09:29:47

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: Move to new server with Ubuntu 16.04

sorhol wrote:

However I am a little concerned about this. I am afraid that if I keep running my sites using Php7 and Mysql 5.7  this could cause problems for me - eg in a future update.

Don't be afraid. [Github] Piwigo commit a09d6e06

Offline

 

#7 2016-09-01 09:33:52

sorhol
Member
2013-07-27
25

Re: Move to new server with Ubuntu 16.04

Thanks a lot Plg.
I will then use Php7 and MySql 5.7 on my new server.
Btw - thank you Piwigo for a great product

Offline

 

#8 2016-10-02 17:52:24

Joe
Guest

Re: Move to new server with Ubuntu 16.04

sorhol wrote:

I found an earlier post where you pointed out that strict mode had to be disabled.

Could you tell me what post that was - I'm having the same problem

 

#9 2016-10-02 18:51:21

sorhol
Member
2013-07-27
25

Re: Move to new server with Ubuntu 16.04

Hi Joe,
I will have to look that up.
It was a post by: Zentalquabula

Offline

 

#10 2016-10-02 18:55:01

sorhol
Member
2013-07-27
25

Re: Move to new server with Ubuntu 16.04

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact