ElkArte Community

Elk Development => Feature Discussion => Topic started by: emanuele on December 06, 2017, 04:12:18 pm

Title: Minimum php version for Elk 2.0
Post by: emanuele on December 06, 2017, 04:12:18 pm
I think we didn't resume the discussion yet for 2.0.

2.0 is likely to be a thing in a couple of years (realistically), so php "stable" should be... 7.4 more or less (1 version per year and 7.2 has just been released few  days ago).
According to http://php.net/supported-versions.php 7.0 has gone out of active support 3 days ago and will receive security fixes for about another year (end 2018).

I think in the recent couple of years, since php started the new release model, the attention has increased and even hosting companies started providing very recent versions of php. Also many projects jumped on the 7.x wagon meaning that the support should be there almost everywhere, even though people may not be aware of it.

So... I think it would be safe to say 7.0 at least or maybe even 7.1 as minimum (considering that 7.1 will receive security updates only until end 2019).

Opinions?

BTWW this topic is twitter's fault for showing me this https://twitter.com/joomla/status/938421673941962753 :P
Title: Re: Minimum php version for Elk 2.0
Post by: Spuds on December 06, 2017, 05:46:51 pm
Agree ... 7.x is what it should be, what .x is time will tell, but starting out with .1 makes the most sense to me.
Title: Re: Minimum php version for Elk 2.0
Post by: ahrasis on December 06, 2017, 08:52:59 pm
I agree with this too. 2.0 should run on at least 7.0 so it will be easier for the developer to focus their energy for betterment rather than backward compatibility to older php version. 7.1 to start with IMHO would be too much though since most linux distro haven't even use that as their default supported php as yet.
Title: Re: Minimum php version for Elk 2.0
Post by: radu81 on December 07, 2017, 02:22:08 am
QuoteAlso many projects jumped on the 7.x wagon meaning that the support should be there almost everywhere
I can confirm that, a few days ago I installed in localhost Joomla 4 (alpha release) and the minimum php version required is 7.0. 
Title: Re: Minimum php version for Elk 2.0
Post by: inter on December 07, 2017, 04:40:01 am
I choose the most recent version for today - php 7.2
Title: Re: Minimum php version for Elk 2.0
Post by: ahrasis on December 07, 2017, 05:28:08 am
I just installed and tested elkarte with php7.2. So far so good...
Title: Re: Minimum php version for Elk 2.0
Post by: vbgamer45 on December 07, 2017, 09:33:16 am
I would go with 7.1 depending on your timeline.
All my current sites are on the latest 7.1.x
Title: Re: Minimum php version for Elk 2.0
Post by: Frenzie on December 07, 2017, 09:54:02 am
PHP 7.1 as a minimum seems fine by me. After all, PHP 7.0 will already be EOL by the time 2.0 will see the light of day. But of course at the same time, one shouldn't randomly break 7.0 or even 5.6 compatibility unless there's a good reason to.

So in that sense I'd say start out with 7.07.1 as a target and should something come up that would be a lot more elegant with 7.17.2 you can just call it a day for 7.07.1 compatibility. :P

Edit: oh, 7.0 is out of active support already? (Sorry, I should've fully read the OP. :-[ Never mind, replace 7.0 and 7.1 by 7.1 and 7.2 in the above then. ;) Still, unless there's a good use case for those void return types it seems like 7.0 is reasonable enough.
Title: Re: Minimum php version for Elk 2.0
Post by: emanuele on December 07, 2017, 12:15:26 pm
Yep, 7.2 doesn't really offers anything that much important in comparison to 7.1.
7.1 has few minor goodies, but then again nothing tremendously relevant.
7.0 is mostly old already. xD

I think the idea is: we continue coding without worrying too much about compatibility with anything below the minimum. If by chance when we are a the end of the release cycle nothing is broken and Elk can run on something lower than the defined minimum that's all good, if it cannot that's good as well.
I don't think we strictly need any 7.0/1 feature, of course we are not forced not to use them if we need them. I hope the sentence makes sense. LOL

Anyway the outcome seems pretty clear: 7.1 seems acceptable.

/me goes thinking about upgrading his development computer now (still running php 5.6).
Title: Re: Minimum php version for Elk 2.0
Post by: Feline on December 08, 2017, 05:23:23 pm
I think a lot of low cost hoster use PHP5.6   :o

So I think this is the lowest level for PHP ... 

And 7.2 have a lot of deprecated functions ... this must checked.

Fel
Title: SPLIT: Goodbye
Post by: emanuele on December 09, 2017, 03:11:37 am
One or more of the messages of this topic have been moved to Chit Chat (https://www.elkarte.net/community/index.php?board=3.0) - https://www.elkarte.net/community/index.php?topic=4794.0
Title: Re: Minimum php version for Elk 2.0
Post by: emanuele on December 09, 2017, 03:17:42 am
Quote from: Feline – I think a lot of low cost hoster use PHP5.6   :o

So I think this is the lowest level for PHP ...
If something were to be released now I would agree (and 1.1 is still 5.3). But if you think of what will be in 2 years from now I don't think many will still be using 5.x.
Title: Re: Minimum php version for Elk 2.0
Post by: Feline on December 09, 2017, 11:08:54 pm
Well .. I lift up our forum to PHP 7.2 Beta and activate Opcode Cache ..
Wow .. Very fast .. half time as on PHP 7.1 without Opcode Cache  :)

Spoiler (click to show/hide)

Fel
Title: Re: Minimum php version for Elk 2.0
Post by: live627 on December 10, 2017, 12:46:33 am
Yaass! Null coalescence operators can be used!
Title: Re: Minimum php version for Elk 2.0
Post by: Frenzie on December 10, 2017, 03:59:45 am
Quote from: Feline – Well .. I lift up our forum to PHP 7.2 Beta and activate Opcode Cache ..
Wow .. Very fast .. half time as on PHP 7.1 without Opcode Cache  :)
So what about 7.1 with opcode cache? :P
Title: Re: Minimum php version for Elk 2.0
Post by: Feline on December 10, 2017, 09:07:36 am
Quote from: live627 – Yaass! Null coalescence operators can be used!

Not true ...
PHP 7 introduced a real coalesce operator:
Code: [Select]
echo $_GET['doesNotExist'] ?? 'fallback'; // prints 'fallback'
If the value before the ?? does not exists or is null the value after the ?? is taken.
The improvement over the mentioned ?: operator is, that the ?? also handles undefined variables without throwing an E_NOTICE.

Fel
Title: Re: Minimum php version for Elk 2.0
Post by: Feline on December 10, 2017, 09:11:31 am
Quote from: Frenzie –
Quote from: Feline – Well .. I lift up our forum to PHP 7.2 Beta and activate Opcode Cache ..
Wow .. Very fast .. half time as on PHP 7.1 without Opcode Cache  :)
So what about 7.1 with opcode cache? :P
A little bit slower then 7.2 ..

Fel
Title: Re: Minimum php version for Elk 2.0
Post by: ahrasis on December 11, 2017, 12:47:20 am
Quote from: Feline – Well .. I lift up our forum to PHP 7.2 Beta and activate Opcode Cache ..
Wow .. Very fast .. half time as on PHP 7.1 without Opcode Cache  :)
How did one activate opcode cache for one's php? I am kinda confused on its implementation while reading about it.
Title: Re: Minimum php version for Elk 2.0
Post by: Joshua Dickerson on December 11, 2017, 02:48:40 am
You can use AWS/GCP for free. Containers are everywhere; minimum versions are a thing of the past. Build applications in the way that's easiest for developers; admins will figure out how to install it.
Title: Re: Minimum php version for Elk 2.0
Post by: Feline on December 11, 2017, 02:18:04 pm
Quote from: ahrasis – How did one activate opcode cache for one's php? I am kinda confused on its implementation while reading about it.
Well .. I think that is different by hoster.
On my hosting I need this.
1. create a new folder in your your_base_directory_full_path with the name .opcache
2. in your php.ini  enter follow:
Code: [Select]
zend_extension=opcache.so;
opcache.enable=1;
opcache.memory_consumption=32;
opcache.interned_strings_buffer=8;
opcache.max_accelerated_files=3000;
opcache.revalidate_freq=180;
opcache.fast_shutdown=0;
opcache.enable_cli=0;
opcache.revalidate_path=0;
opcache.validate_timestamps=2;
opcache.max_file_size=0;
opcache.file_cache=/your_base_directory_full_path/.opcache;
opcache.file_cache_only=1;

I dont known if this work on your server ...

Fel
Title: Re: Minimum php version for Elk 2.0
Post by: ahrasis on December 11, 2017, 08:17:11 pm
I use my own private server and I think I should be able to do this on website-to-website basis. Thank you for the how to.
Title: Re: Minimum php version for Elk 2.0
Post by: Feline on December 16, 2017, 08:35:26 am
Have you tested that and works ?
Title: Re: Minimum php version for Elk 2.0
Post by: ahrasis on December 16, 2017, 10:59:29 pm
I haven't got a chance yet. Busy finishing cluster / mirror server. Hopefully I can manage before this year end.
Title: Re: Minimum php version for Elk 2.0
Post by: ahrasis on December 21, 2017, 11:27:42 pm
I implemented this opcache and it seems working with level two under Alternative Php Caching. I will see how it goes from here for the coming weeks. Thank you for the tip.