ElkArte Community

Project Support => Support => Topic started by: Jorin on October 28, 2016, 01:32:56 am

Title: Is ElkArte working with PHP 7.0
Post by: Jorin on October 28, 2016, 01:32:56 am
My hoster plans to get rid of old unsupported PHP versions in November and I can choose between 5.5, 5.6 and 7.0. Actually I am using 5.3.28.

If it's okay with ElkArte I would change to 7.0. But I am an absolute noob with this things. Any hints?
Title: Re: Is ElkArte working with PHP 7.0
Post by: emanuele on October 28, 2016, 03:37:13 am
I'm not confident enough to say "it works 100%". What I can say is "it should work, it may have issues with sessions.".
If you can easily switch between one and the other, I would suggest to try it out a day or so and if you do not experience any problem, keep using it.
Otherwise go for 5.6.
Title: Re: Is ElkArte working with PHP 7.0
Post by: Jorin on October 28, 2016, 03:46:36 am
Thanks!  :)
Title: Re: Is ElkArte working with PHP 7.0
Post by: radu81 on October 28, 2016, 04:53:11 am
There is a topic around about php 7.0... I used it for a few hours on my forum, but I noticed it was impossible to mention a member so switched back to php 5.6. Don't know if this was solved in the meantime, I did the test a few months ago.
Title: Re: Is ElkArte working with PHP 7.0
Post by: Jorin on October 28, 2016, 06:01:24 am
Hm, mentions seems to work.

But as I said, I am no expert and I don't know if it really uses PHP 7.0 now. In my config tool I had to switch the domains to PHP 7.0, while the overview of my account still shows 5.3 for the server PHP version. confused
Title: Re: Is ElkArte working with PHP 7.0
Post by: badmonkey on October 28, 2016, 07:15:04 am
What timing for this question!  Just tried out 7.0 and 7.1 last night.  Sessions were completely broken in 7.1.  Dropped back to 7.0.  No session issues so far.  Can concur mentions are broken.  Thanks for mentioning that (no pun intended).
Title: Re: Is ElkArte working with PHP 7.0
Post by: Jorin on October 28, 2016, 08:11:18 am
Right. Mentioning a username isn't working with 7.0.  :(
Title: Re: Is ElkArte working with PHP 7.0
Post by: badmonkey on October 28, 2016, 09:52:02 am
Woops!  Spoke too soon.  There is a session issue in 7.0 after all.  The error logs are full of:

Type of error: General
Apply Filter: Only show the errors with the same message 2: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct ()

and

Type of error: General
Apply Filter: Only show the errors with the same message 2: Unknown: Session callback expects true/false return value





Title: Re: Is ElkArte working with PHP 7.0
Post by: badmonkey on October 28, 2016, 11:06:36 am
Here are the errors related to mentions while using php 7.0:

Type of error: General
8: Array to string conversion
File: /home/xxxx/public_html/sources/controllers/Suggest.controller.php
Line: 80


Type of error: Undefined
 8: Undefined property: Suggest::$Array
File: /home/xxxx/public_html/sources/controllers/Suggest.controller.php
Line: 80
Title: Re: Is ElkArte working with PHP 7.0
Post by: badmonkey on October 28, 2016, 11:28:49 am
Here's a fix for mentions in php 7.0:


Edit /sources/controllers/Suggest.controller.php line 80 to:

Code: [Select]
$context['xml_data'] = $suggest->{$currentSearch['function']}();
Title: Re: Is ElkArte working with PHP 7.0
Post by: badmonkey on October 28, 2016, 12:01:01 pm
Note:  UNCHECKING "Use database driven sessions" eliminates the errors in the error log. 
Title: Re: Is ElkArte working with PHP 7.0
Post by: radu81 on October 28, 2016, 02:17:29 pm
Quote from: Jorin – and I don't know if it really uses PHP 7.0 now.
You can check that  from the admin panel of elkarte: Admin -> Server Settings -> PHP info (or use this link /index.php?action=admin;area=serversettings;sa=phpinfo )
Title: Re: Is ElkArte working with PHP 7.0
Post by: ahrasis on October 28, 2016, 09:24:19 pm
5.5 and 5.6 will be good to go for Elk. 7.0, I suppose will still have to undergo more tests.