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
In local/config/database.inc.php make sure you have selected mysqli:
$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
Thanks!
I will try this.
Offline
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
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
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
Online
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
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
Hi Joe,
I will have to look that up.
It was a post by: Zentalquabula
Offline