This Help forum is for issues relates to the latest release (1.7.9). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."

TOPIC: Compatible with PHP 7.2.2 ?

Compatible with PHP 7.2.2 ? 3 months 1 week ago #1

  • WGroleau
  • WGroleau's Avatar
  • Offline
  • Gold
  • Posts: 1494
I was considering updating PHP. My site has 7.1.13; the latest version is pretty new, 7.2.2. Is there any reason to be wary?
--
Wes Groleau
UniGen.us/
PHP 7.1.13; MySQL 5.6.38; Apache
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 3 months 1 week ago #2

  • mp
  • mp's Avatar
  • Offline
  • Junior
  • Posts: 170
webtrees 1.7.9 was designed for PHP 7.0 or lower. With all fixes for 1.7.9 since December 2016 it works with 7.1 too, but you can't update automatically. For an update you have to change the PHP version to 7.0.

It seems that webtrees 1.7.9 works with PHP 7.2 too, but at least the relationship calculation doesn't work. I tested this with MAMP 4.4.1 and PHP 7.2 on my local desktop.
Martin - ffp.bauschaffen.de
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 3 months 1 week ago #3

  • WGroleau
  • WGroleau's Avatar
  • Offline
  • Gold
  • Posts: 1494
I already have 1.7.9. It’s PHP that needs the update. Getting the latest is easier than getting an older version.
--
Wes Groleau
UniGen.us/
PHP 7.1.13; MySQL 5.6.38; Apache
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 3 months 1 week ago #4

  • mp
  • mp's Avatar
  • Offline
  • Junior
  • Posts: 170
As I wrote webtrees 1.7.9 in general will work with PHP 7.2 too, but some parts not. You can test it and report which parts are not working after.

The webtrees update function works only with PHP 7.0 well.
Martin - ffp.bauschaffen.de
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 3 months 1 week ago #5

  • bertkoor
  • bertkoor's Avatar
  • Offline
  • Gold
  • Greetings from Utrecht, Holland
  • Posts: 1369
WGroleau wrote:
Is there any reason to be wary?

Yeah, many. You've been away too long...
www.webtrees.net/index.php/en/forum/sear...%207.1&childforums=1
stamboom.BertKoor.nl runs on webtrees v1.7.9
Last Edit: 3 months 1 week ago by bertkoor.
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 3 months 3 days ago #6

  • magic-sunday
  • magic-sunday's Avatar
  • Offline
  • New
  • Posts: 53
webtrees is not fully compatible with PHP 7.2, as PHP 7.2 deprecated for instance the method "each", some parts (e.g. RelationshipController, Dijkstra) may not function as expected.
webtrees, latest dev
PHP 7.1.8
Last Edit: 3 months 3 days ago by magic-sunday.
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 1 week 2 days ago #7

  • Shemwell
  • Shemwell's Avatar
  • Offline
  • Junior
  • Posts: 178
I was able to get everything(I think) working with PHP 7.2.4 on my server by replacing
webtrees\app\Controller\RelationshipController.php
line 77 with:

while (current($queue) !== false) {
$next = current($queue);
next($queue);

and webtrees\vendor\fisharebest\algorithm\src\Dijkstra.php
lines 84 and 85 with:

while (current($paths) !== false) {
$key = key($paths);
$path = current($paths);
next($paths);
if (!empty($this->previous[$path[0]])) {

I'm not sure if that's the best code but everything seems to be working well for the last few weeks... Are there any other problems running PHP 7.2.4 I should be aware of?.

Thanks
Barry
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 1 week 1 day ago #8

  • buovjaga
  • buovjaga's Avatar
  • Offline
  • New
  • Posts: 7
I'm getting this with PHP 7.2.1, when clicking on a surname from Lists - Families:

/var/www/site/webtrees/includes/session.php:193 /var/www/site/webtrees/app/GedcomRecord.php:642 count(): Parameter must be an array or an object that implements Countable #0 unknown:unknown ErrorException("/var/www/site/webtrees/app/GedcomRecord.php:642 count(): Parameter must be an array or an object that implements Countable") #1 /app/GedcomRecord.php:642 count([NULL]) #2 /app/GedcomRecord.php:748 getPrimaryName() #3 /app/GedcomRecord.php:711 getSortName() #4 unknown:unknown compare([Family F13@1], [Family F12@1]) #5 /app/Query/QueryName.php:531 usort([array], '\\Fisharebest\\Webtrees\\GedcomRe…') #6 /famlist.php:261 families([Tree], 'SURNAME', 'S', '', false)

I could not find an existing discussion about this. count() is throwing an E_WARNING: php.net/manual/en/migration72.incompatible.php "An E_WARNING will now be emitted when attempting to count() non-countable types"
What is the recommended way to suppress this warning?
Last Edit: 6 days 6 hours ago by buovjaga.
The administrator has disabled public write access.
Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

Compatible with PHP 7.2.2 ? 6 days 5 hours ago #9

  • buovjaga
  • buovjaga's Avatar
  • Offline
  • New
  • Posts: 7
Solved the above problem by changing the line github.com/fisharebest/webtrees/blob/1.7...edcomRecord.php#L641 to

if ($this->getAllNames() && count($this->getAllNames()) > 1) {
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 6 days 1 hour ago #10

  • Shemwell
  • Shemwell's Avatar
  • Offline
  • Junior
  • Posts: 178
I can't replicate an error when clicking on a surname from Lists - Families: with 7.2.5 so I'm reluctant to change it.

I did discover when trying to .zip a gedcom for download you get an error.
fix...
webtrees\vendor\pclzip\pclzip\pclzip.lib.php
change line 1797 to:
$v_memory_limit = substr($v_memory_limit, 0, -1);
Barry
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 6 days 56 minutes ago #11

  • buovjaga
  • buovjaga's Avatar
  • Offline
  • New
  • Posts: 7
Shemwell wrote:
I can't replicate an error when clicking on a surname from Lists - Families: with 7.2.5 so I'm reluctant to change it.

I did discover when trying to .zip a gedcom for download you get an error.
fix...
webtrees\vendor\pclzip\pclzip\pclzip.lib.php
change line 1797 to:
$v_memory_limit = substr($v_memory_limit, 0, -1);

I created an issue for it and later realised the warning is only thrown for certain surnames: github.com/fisharebest/webtrees/issues/1731
I emailed Greg with my var_dumps.

It still seems certain that the use of count() has to be changed across the webtrees codebase.
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 3 days 8 hours ago #12

  • buovjaga
  • buovjaga's Avatar
  • Offline
  • New
  • Posts: 7
The root issue turned out to be people with married names, but no original surnames. Greg had fixed an issue related to those in 2017. I applied the patch and it made the warning go away. I still think the use of count() should be tweaked, but will leave it to the devs to decide.
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 3 days 7 hours ago #13

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10250
> I still think the use of count() should be tweaked, but will leave it to the devs to decide.

I won't change this. It will simply hide the other error.
The whole point of the "strict" changes in PHP 7.2 is to help find errors like this.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Compatible with PHP 7.2.2 ? 3 days 7 hours ago #14

  • buovjaga
  • buovjaga's Avatar
  • Offline
  • New
  • Posts: 7
Ok, then it was my misunderstanding.
The administrator has disabled public write access.
Powered by Kunena Forum