icecoder/ICEcoder

PHP 7.0+ claimed as minimal requirement but PHP 7.1 is the minimum requirement instead!

progettoautomazione opened this issue · 9 comments

Hi, I read in product documentation that PHP requirement is PHP 7.0+ but I think the minimum is PHP 7.1+! Correct me if I'm wrong, or please update documentation.
Thanks

@progettoautomazione it should be fine on 7.0 - is there something you think only works on 7.1?

@progettoautomazione it should be fine on 7.0 - is there something you think only works on 7.1?

Thanks @mattpass for your hyper-quick response. I'm receiving this error:
Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function session_create_id() in /var/www/dev.progestnow.com/ICE/lib/settings-common.php:29\nStack trace:\n#0 /var/www/dev.progestnow.com/ICE/lib/headers.php(10)

The same procedure, on a PHP 7.4 server, works well with no this error...

Reading PHP.net website, I found that session_create_id() function exist only in php 7.1 or higher

@progettoautomazione hmm, seems you're quite right, thanks for pointing this out.

I'll probably see what can be done to make that part work OK with 7.0 also rather than move required version to 7.1.

@progettoautomazione hmm, seems you're quite right, thanks for pointing this out.

I'll probably see what can be done to make that part work OK with 7.0 also rather than move required version to 7.1.

@mattpass that would be amazing because I'm stuck to PHP 7.0 so far so I would not be able to use your IDE!
Thanks

@mattpass I'm new of this project, can I ask which kind of release policy are you following? Just to know what to expect in terms of timing for this fixing, so that I can plan my near-future moves. Thanks

FYI, In the meantime I probably fixed it by changing in settings.common.php from:

if(false === isset($_COOKIE['ICEcoder'])) {
		$_COOKIE['ICEcoder'] = session_create_id();
	}

To:

if(false === isset($_COOKIE['ICEcoder'])) {
      session_start();
      $_COOKIE['ICEcoder'] = session_id();
}

After this change the IDE works, even thou 1 out of 10 operations I make (open a folder/file/save/etc) takes like 3-4 minutes to be executed, like if the session is busy/queued. So, maybe mine it's not a real solution.

@mattpass I'm new of this project, can I ask which kind of release policy are you following? Just to know what to expect in terms of timing for this fixing, so that I can plan my near-future moves. Thanks

There tends to be 3-4 releases a year and the next will probably be just before year end.

As a follow up to this - I've set it up in a PHP 7.0 env and can see reproduce issues you mentioned for the line indicated. The code in that area was introduced for ICEcoder 8.1 as a way to have multiple sessions running (eg WordPress running and ICEcoder also, under its own session).

The code was inspired by the alternative solution in this SO post: https://stackoverflow.com/questions/24964699/php-how-can-i-create-multiple-sessions but I think it may not be an fit for purpose and the logic may need improving. The main aims here are to allow for multiple PHP sessions and a little further down, also avoid session fixation. I'd like to continue supporting PHP 7.0 for the foreseeable future (especially as this is the only item not 7.0 compatible, needs 7.1).

The solution you proposed seems like a good short term fix for yourself, but unsure why it would on occasions take a few mins - perhaps your garbage collection rules?

I'll look into revising the logic here in the near future anyway, to ensure it's 7.0 compatible, I just want to also retain multiple session abilities and avoid session fixation.

Have adjusted logic a little to cater for PHP v7.0 - 509b5b8 and so closing.