Announcement

#1 2015-07-22 01:15:40

Zentalquabula
Member
2014-05-10
217

Php 7.0

Is Piwigo being updated anytime soon to be compatible with PHP 7? These are some errors generated:

PHP Fatal error:  Uncaught Error: Call to undefined function set_magic_quotes_runtime() in /include/common.inc.php:29

PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; AMM_PIP has a deprecated constructor in /plugins/AMenuManager/amm_pip.class.inc.php on line 549

Offline

 

#2 2015-08-19 11:23:43

ErikM
Member
Netherlands
2015-08-19
1

Re: Php 7.0

If you edit the include/common.inc.php and put 2 forward slashes before that rule 29 (//@set_magic_quotes_runtime(0); // Disable magic_quotes_runtime) php7 will work, even with the deprecated warnings/errors.
But al lot of other issues will appear if you use al lot of plugins and themes that are not ready for php7. Switching themes can cause a site failure for example.

I hope and think that with the new version this wil be resolved.

I have done some testing with php7 and it is indeed a lot quicker as an older php version.

Offline

 

#3 2015-12-05 23:03:53

layanto
Member
2015-09-12
5

Re: Php 7.0

Getting this fatal error with PHP7:

Fatal error: Uncaught Error: Function name must be a string in include\smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php:321 Stack trace: #0

Offline

 

#4 2015-12-06 00:33:30

Zentalquabula
Member
2014-05-10
217

Re: Php 7.0

Now going live with PHP 7, and I get these errors:

[Sun Dec 06 00:30:09.668604 2015] [:error] [pid 389] [client a.b.c.d:54311] PHP Notice:  Array to string conversion in /path/admin/include/updates.class.php on line 143, referer: http://site.ext/admin.php?action=check_upgrade
[Sun Dec 06 00:30:09.670868 2015] [:error] [pid 389] [client a.b.c.d:54311] PHP Notice:  Undefined property: updates::$Array in /path/admin/include/updates.class.php on line 143, referer: http://site.ext/admin.php?action=check_upgrade
[Sun Dec 06 00:30:09.671024 2015] [:error] [pid 389] [client a.b.c.d:54311] PHP Notice:  Undefined offset: 9 in /path/admin/include/updates.class.php on line 143, referer: http://site.ext/admin.php?action=check_upgrade
[Sun Dec 06 00:30:09.671144 2015] [:error] [pid 389] [client a.b.c.d:54311] PHP Warning:  Creating default object from empty value in /path/admin/include/updates.class.php on line 143, referer: http://site.ext/admin.php?action=check_upgrade
[Sun Dec 06 00:30:09.671260 2015] [:error] [pid 389] [client a.b.c.d:54311] PHP Notice:  Undefined property: stdClass::$server_themes in /path/admin/include/updates.class.php on line 143, referer: http://site.ext/admin.php?action=check_upgrade
[Sun Dec 06 00:30:09.671690 2015] [:error] [pid 389] [client a.b.c.d:54311] PHP Fatal error:  Uncaught Error: Unsupported operand types in /path/admin/include/updates.class.php:143\nStack trace:\n#0 /path/admin/include/updates.class.php(158): updates->get_server_extensions()\n#1 /path/include/ws_functions/pwg.extensions.php(323): updates->check_extensions()\n#2 /path/include/ws_core.inc.php(608): ws_extensions_checkupdates(Array, Object(PwgServer))\n#3 /path/include/ws_protocols/rest_handler.php(56): PwgServer->invoke('pwg.extensions....', Array)\n#4 /path/include/ws_core.inc.php(296): PwgRestRequestHandler->handleRequest(Object(PwgServer))\n#5 /path/ws.php(94): PwgServer->run()\n#6 {main}\n  thrown in /path/admin/include/updates.class.php on line 143, referer: http://site.ext/admin.php?action=check_upgrade

Offline

 

#5 2015-12-08 21:21:10

Zentalquabula
Member
2014-05-10
217

Re: Php 7.0

[Tue Dec 08 21:17:53.291551 2015] [:error] [pid 7115] [client a.b.c.d:49288] PHP Catchable fatal error:  session_regenerate_id(): Failed to create(read) session ID: user (path: /var/lib/php/sessions) in /path/include/functions_user.inc.php on line 955

Offline

 

#6 2015-12-08 21:32:39

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

Re: Php 7.0

For now, I don't have an environment with PHP7 running. If you have skills in coding, it would be great to get some pull-requests on Github to fix these bugs :-)

Offline

 

#7 2015-12-10 12:23:41

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

Re: Php 7.0

layanto wrote:

Getting this fatal error with PHP7:

Fatal error: Uncaught Error: Function name must be a string in include\smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php:321 Stack trace: #0

This bug will be fixed in Smarty 3.1.28 (and currently the last version is 3.1.27). I'm running the unstable version of Smarty and this bug is fixed for PHP 7.

(I installed an environment with PHP7, I'm listing problems and try to fix them)

Offline

 

#8 2015-12-10 14:08:30

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

Re: Php 7.0

[Github] Piwigo issue #385 already removes many errors/notices/deprecated

I still see errors with admin/include/updates.class.php :

PHP Notice:  Array to string conversion in admin/include/updates.class.php on line 143, referer: admin.php
PHP Notice:  Undefined property: updates::$Array in admin/include/updates.class.php on line 143, referer: admin.php
PHP Notice:  Undefined offset: 9 in admin/include/updates.class.php on line 143, referer: admin.php
PHP Warning:  Creating default object from empty value in admin/include/updates.class.php on line 143, referer: admin.php
PHP Notice:  Undefined property: stdClass::$server_themes in admin/include/updates.class.php on line 143, referer: admin.php
PHP Fatal error:  Uncaught Error: Unsupported operand types in admin/include/updates.class.php:143\nStack trace:\n#0 admin/include/updates.class.php(158): updates->get_server_extensions()\n#1 include/ws_functions/pwg.extensions.php(323): updates->check_extensions()\n#2 include/ws_core.inc.php(608): ws_extensions_checkupdates(Array, Object(PwgServer))\n#3 include/ws_protocols/rest_handler.php(56): PwgServer->invoke('pwg.extensions....', Array)\n#4 include/ws_core.inc.php(296): PwgRestRequestHandler->handleRequest(Object(PwgServer))\n#5 ws.php(94): PwgServer->run()\n#6 {main}\n  thrown in admin/include/updates.class.php on line 143, referer: admin.php

Needs to be fixed

Offline

 

#9 2016-03-07 11:47:00

AndrzejL
Member
2014-03-10
6

Re: Php 7.0

Guys how is the love story between php 7 and piwigo progressing?

Edit: Never mind ;)... I just moved to the git version and its peachy.

Cheers.

Andrzej

Last edited by AndrzejL (2016-03-07 12:39:01)

Offline

 

#10 2016-07-28 15:28:40

Condorman75
Guest

Re: Php 7.0

Hello,

I updated to piwigo 2.8.2 on OVH server
With PHP 5.6 : all works good
With PHP 7, i get this error message  :

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/xxxxxx/www/piwigo/include/dblayer/functions_mysql.inc.php:38 Stack trace: #0 /home/xxxxxx/www/piwigo/include/common.inc.php(117): pwg_db_connect(XXXXXX) #1 /home/xxxxx/www/piwigo/admin.php(31): include_once('/home/xxxxxxxx/ww...') #2 {main} thrown in /home/xxxxxx/www/piwigo/include/dblayer/functions_mysql.inc.php on line 38

-----
In french :

Bonjour,

J'ai mis à jour vers la version 2.8.2 sur un serveur mutualisé OVH.
Quand je suis en PHP 5.6 : pas de problème
En revanche, en version PHP7, j'obtiens ce message d'erreur dès que je veux afficher une page :

 

#11 2016-07-29 10:12:02

Zentalquabula
Member
2014-05-10
217

Re: Php 7.0

The mysql driver is deprecated in PHP 7. You need to use mysqli. (Unfortunately, there is no PDO.)

Edit local/config/database.inc.php and make sure it says this:

Code:

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

Last edited by Zentalquabula (2016-07-29 10:12:35)

Offline

 

#12 2016-07-29 15:09:35

Condorman75
Guest

Re: Php 7.0

Merci beaucoup. C'est parfait à présent.

 

#13 2016-08-16 12:47:50

Moophlles
Guest

Re: Php 7.0

Hi all,
I just tried a fresh install of piwigo on an ubuntu with PHP7 an I get an error while trying to access my album


Warning:  [mysql error 3065] Expression #1 of ORDER BY clause is not in SELECT list, references column 'piwigo.piwigo_images.date_available' 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 = 1

  ORDER BY date_available DESC, file ASC, id ASC
; in /var/www/piwigo/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/piwigo/include/dblayer/functions_mysqli.inc.php:893 Stack trace: #0 /var/www/piwigo/include/section_init.inc.php(318): query2array('\nSELECT DISTINC...', NULL, 'image_id') #1 /var/www/piwigo/index.php(27): include('/var/www/piwigo...') #2 {main} thrown in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 893

What can I do?
I checked for $conf['dblayer'] = 'mysqli'; and it's OK
Thanks in advance

 

#14 2016-08-16 19:18:39

Zentalquabula
Member
2014-05-10
217

Re: Php 7.0

http://piwigo.org/forum/viewtopic.php?id=26730

Moophlles wrote:

Hi all,
I just tried a fresh install of piwigo on an ubuntu with PHP7 an I get an error while trying to access my album


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

Offline

 

#15 2016-08-17 09:21:12

Moophlles
Guest

Re: Php 7.0

Zentalquabula wrote:

http://piwigo.org/forum/viewtopic.php?id=26730

Moophlles wrote:

Hi all,
I just tried a fresh install of piwigo on an ubuntu with PHP7 an I get an error while trying to access my album


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

Great, it works ! Thanks =D

 

Board footer

Powered by FluxBB

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